Kernel: Don't delete futex objects after they are not used anymore
Hashmap insertions and deletions made futex very slow to use. When running SuperTuxKart, ~15% of cpu time was spent doing these. Never freeing objects is not great either but at least the performance is usable now :)
This commit is contained in:
@@ -3160,9 +3160,9 @@ namespace Kernel
|
||||
futex_t* const futex = it->value.ptr();
|
||||
|
||||
futex->waiters++;
|
||||
BAN::ScopeGuard _([&futexes, futex, paddr] {
|
||||
if (--futex->waiters == 0)
|
||||
futexes.remove(paddr);
|
||||
BAN::ScopeGuard _([futex] {
|
||||
// TODO: Lazily deallocate unused futex objects at some point (?)
|
||||
futex->waiters--;
|
||||
});
|
||||
|
||||
for (;;)
|
||||
|
||||
Reference in New Issue
Block a user