]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:g_lock: use TDB_VOLATILE to avoid fcntl locks
authorStefan Metzmacher <metze@samba.org>
Wed, 10 Aug 2022 13:16:14 +0000 (13:16 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 11 Aug 2022 18:28:36 +0000 (18:28 +0000)
This improves 'time smbtorture3 //foo/bar -U% local-g-lock-ping-pong -o 50000000'
from ~1.400.000 to ~3.400.000 operations per second any a testsystem.

As we also use TDB_VOLATILE for locking.tdb, this is a much more
realistic test now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/g_lock.c

index 52a1cf9fa4677624e8fd79c8b42b46d5343a6a07..d683c4ddee6f42f9217bfbad0b5cb393dacad5de 100644 (file)
@@ -236,7 +236,7 @@ struct g_lock_ctx *g_lock_ctx_init(TALLOC_CTX *mem_ctx,
                mem_ctx,
                db_path,
                0,
-               TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
+               TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH|TDB_VOLATILE,
                O_RDWR|O_CREAT,
                0600,
                DBWRAP_LOCK_ORDER_3,