From waddlesplash <waddlesplash@xxxxxxxxx>:
waddlesplash has uploaded this change for review. (
https://review.haiku-os.org/c/haiku/+/1663
Change subject: kernel: Granularize ConditionVariable locking.
......................................................................
kernel: Granularize ConditionVariable locking.
Before this commit, *all* ConditionVariable operations (yes, all;
even Wait, Notify, etc.) went through a single spinlock, that also
protected the sConditionVariableHash. This obviously does not scale
so well with core count, to say the least!
With this commit, we add spinlocks to each Variable and Entry.
This makes locking somewhat more complicated (and nuanced; see
inline comment), but the trade-off seems completely worth it:
(compile HaikuDepot in VMware, 2 cores)
before
real 1m20.219s
user 1m5.619s
sys 0m40.724s
after
real 1m12.667s
user 0m57.684s
sys 0m37.251s
The more cores there are, the more of an optimization this will
likely prove to be. But 10%-across-the-board is not bad to say
the least.
---
M headers/private/kernel/condition_variable.h
M src/system/kernel/condition_variable.cpp
2 files changed, 99 insertions(+), 73 deletions(-)
git pull ssh://git.haiku-os.org:22/haiku refs/changes/63/1663/1
--
To view, visit https://review.haiku-os.org/c/haiku/+/1663
To unsubscribe, or for help writing mail filters, visit
https://review.haiku-os.org/settings
Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I1e40a997fff58a79e987d7cdcafa8f7358e1115a
Gerrit-Change-Number: 1663
Gerrit-PatchSet: 1
Gerrit-Owner: waddlesplash <waddlesplash@xxxxxxxxx>
Gerrit-MessageType: newchange