1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
samba-mirror/source3
Stefan Metzmacher 9d99911663 s3:dbwrap_watch: only notify the first waiter
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>
2022-07-26 13:40:34 +00:00
..
auth s3:smbd: Free allocated strings before leaving user_in_netgroup() function 2022-06-09 22:40:43 +00:00
build
client s3/client: fix dfs deltree, resolve dfs path 2022-06-17 17:12:07 +00:00
exports
groupdb lib: relicense smb_strtoul(l) under LGPLv3 2020-08-03 22:21:02 +00:00
include s3:libads: Remove no longer used is_mine flag from ADS_STRUCT 2022-06-27 15:50:30 +00:00
intl
lib s3:dbwrap_watch: only notify the first waiter 2022-07-26 13:40:34 +00:00
libads s3: libads: Fix coverity false positive. 2022-07-04 16:42:28 +00:00
libgpo/gpext
libnet s3:libads: Allocate ads->auth.ccache_name under ADS_STRUCT talloc context 2022-06-27 15:50:30 +00:00
librpc lib/util: Change function to mem_equal_const_time() 2022-06-09 22:49:29 +00:00
libsmb s3:winbind: Improve logging in samlogon_cache.c 2022-07-15 14:25:38 +00:00
locale spelling: connnect encrytion exisit expection explicit invalide missmatch paramater paramter partion privilige relase reponse seperate unkown verson authencication progagated 2022-06-10 18:12:33 +00:00
locking s3: smbd: Move implicit call to lp_posix_cifsu_locktype() out of init_strict_lock_struct(). 2022-01-06 15:11:38 +00:00
modules vfs_error_inject: Ignore openat() from openat_pathref_dirfsp_nosymlink() 2022-07-25 12:04:33 +00:00
nmbd source3: move lib/substitute.c functions out of proto.h 2021-11-11 13:49:32 +00:00
param dsdb: Allow password history and password changes without an NT hash 2022-06-26 22:10:29 +00:00
passdb librpc:ndr: Update ndr_print_debug() to the new ndr ABI 2022-07-15 14:25:38 +00:00
printing s3:printing: Do not clear the printer-list.tdb 2022-06-30 22:08:39 +00:00
profile s3:profile: make use of tevent_cached_getpid() in performance critical code 2022-07-25 18:32:18 +00:00
registry registry3: Align an integer type 2022-07-25 12:04:33 +00:00
rpc_client spelling: connnect encrytion exisit expection explicit invalide missmatch paramater paramter partion privilige relase reponse seperate unkown verson authencication progagated 2022-06-10 18:12:33 +00:00
rpc_server mdssvc: return all-zero policy handle if spotlight is disabled 2022-07-12 15:42:52 +00:00
rpcclient s3:rpcclient: Goto done in cmd_samr_setuserinfo_int() 2022-07-18 21:21:59 +00:00
script smbd: Userspace symlink eval in filename_convert_dirfsp() 2022-07-25 12:56:08 +00:00
selftest s4:torture: Rename rpc.samr.passwords tests 2022-07-15 13:28:37 +00:00
services s3:services: Disable rcinit-based service control code 2021-12-10 14:02:30 +00:00
smbd s3:smbXsrv_session: only change the dbwrap_watch instance when the record has changed 2022-07-26 13:40:34 +00:00
torture s3:dbwrap_watch: allow callers of dbwrap_watched_watch_send/recv() to manage the watcher instances 2022-07-26 13:40:34 +00:00
utils testparm: clarify "Weak crypto is allowed" message 2022-07-01 14:35:09 +00:00
web
winbindd winbind: Fix a "format string is not a string literal" warning 2022-07-23 23:29:38 +00:00
.clang_complete
.dmallocrc
.indent.pro
Doxyfile
mainpage.dox
smbadduser.in
wscript Revert "s3:smbd: Remove NIS support" 2022-06-09 21:45:28 +00:00
wscript_build s3:waf: Fix version number of public libsmbconf 2022-06-24 09:48:38 +00:00
wscript_configure_system_ncurses