mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
9d99911663
In case of a highly contended record we will have a lot of watchers, which will all race to get g_lock_lock() to finish. If g_lock_unlock() wakes them all, e.g. 250 of them, we get a thundering herd, were 249 will only find that one of them as able to get the lock and re-add their watcher entry (not unlikely in a different order). With this commit we only wake the first watcher and let it remove itself once it no longer wants to monitor the record content (at that time it will wake the new first watcher). It means the woken watcher doesn't have to race with all others and also means order of watchers is kept, which means that we most likely get a fair latency distribution for all watchers. The following test with 256 commections all looping with open/close on the same inode (share root) is improved drastically: smbtorture //127.0.0.1/m -Uroot%test smb2.create.bench-path-contention-shared \ --option='torture:bench_path=' \ --option="torture:timelimit=60" \ --option="torture:nprocs=256" From some like this: open[num/s=80,avslat=2.793862,minlat=0.004097,maxlat=46.597053] close[num/s=80,avslat=2.387326,minlat=0.023875,maxlat=50.878165] to: open[num/s=8800,avslat=0.021445,minlat=0.000095,maxlat=0.179786] close[num/s=8800,avslat=0.021658,minlat=0.000044,maxlat=0.179819] BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> |
||
---|---|---|
.. | ||
auth | ||
build | ||
client | ||
exports | ||
groupdb | ||
include | ||
intl | ||
lib | ||
libads | ||
libgpo/gpext | ||
libnet | ||
librpc | ||
libsmb | ||
locale | ||
locking | ||
modules | ||
nmbd | ||
param | ||
passdb | ||
printing | ||
profile | ||
registry | ||
rpc_client | ||
rpc_server | ||
rpcclient | ||
script | ||
selftest | ||
services | ||
smbd | ||
torture | ||
utils | ||
web | ||
winbindd | ||
.clang_complete | ||
.dmallocrc | ||
.indent.pro | ||
Doxyfile | ||
mainpage.dox | ||
smbadduser.in | ||
wscript | ||
wscript_build | ||
wscript_configure_system_ncurses |