s3:smbd: only run validate_oplock_types() with smbd:validate_oplock_types = yes
authorStefan Metzmacher <metze@samba.org>
Fri, 19 Aug 2022 15:17:41 +0000 (15:17 +0000)
committerJule Anger <janger@samba.org>
Tue, 23 Aug 2022 07:46:18 +0000 (07:46 +0000)
commit6bf37ba4538b309bf455c26ab0aeca6ba376d552
tree31f8c9f783f316e39954e16a3a9d8ae0b08007a4
parentf207ef332244c0bc935dfbbe668d78617803994c
s3:smbd: only run validate_oplock_types() with smbd:validate_oplock_types = yes

This is really expensive as share_mode_forall_entries() is currently
doing a talloc_memdup() of the whole record...

This is mainly used to avoid regressions, so only
use smbd:validate_oplock_types = yes in make test,
but skip it for production.

This improves the following test:

 time smbtorture //127.0.0.1/m -Uroot%test \
        smb2.create.bench-path-contention-shared \
        --option='torture:bench_path=file.dat' \
        --option="torture:timelimit=60" \
        --option="torture:nprocs=256" \
        --option="torture:qdepth=1"

From:

   open[num/s=8852,avslat=0.014999,minlat=0.000042,maxlat=0.054600]
   close[num/s=8850,avslat=0.014136,minlat=0.000025,maxlat=0.054537]

to:

   open[num/s=11377,avslat=0.012075,minlat=0.000041,maxlat=0.054107]
   close[num/s=11375,avslat=0.010594,minlat=0.000023,maxlat=0.053620]

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>
(cherry picked from commit 0fbca175ae4763d82f8a414ee3d6354c95d5294e)
selftest/target/Samba3.pm
selftest/target/Samba4.pm
source3/smbd/open.c