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:
parent
343aef31c3
commit
311a68160c
|
|
@ -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 (;;)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue