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:
Bananymous 2026-01-12 23:49:18 +02:00
parent 343aef31c3
commit 311a68160c
1 changed files with 3 additions and 3 deletions

View File

@ -3160,9 +3160,9 @@ namespace Kernel
futex_t* const futex = it->value.ptr(); futex_t* const futex = it->value.ptr();
futex->waiters++; futex->waiters++;
BAN::ScopeGuard _([&futexes, futex, paddr] { BAN::ScopeGuard _([futex] {
if (--futex->waiters == 0) // TODO: Lazily deallocate unused futex objects at some point (?)
futexes.remove(paddr); futex->waiters--;
}); });
for (;;) for (;;)