]> git.ipfire.org Git - thirdparty/openssl.git/commit
hashtable: add option to disable RCU locks
authorNikola Pajkovsky <nikolap@openssl.org>
Thu, 25 Sep 2025 16:32:17 +0000 (18:32 +0200)
committerNeil Horman <nhorman@openssl.org>
Thu, 2 Oct 2025 12:05:02 +0000 (08:05 -0400)
commit512f176185ebcd98810e181601fcaf7f340439e9
tree6f9623db3891f670545ae962385c3838ee229672
parent18763ea15507ecd3cb24d717fd6e738223272391
hashtable: add option to disable RCU locks

a new config option _no_rcu_ is added into HT_CONFIG. When _no_rcu_ is
set then hashtable can be guarded with any other locking primitives,
and behives as ordinary hashtable. Also, all the impact of the
atomics used internally to the hash table was mitigated.

RCU performance

   # INFO:  @ test/lhash_test.c:747
   # multithread stress runs 40000 ops in 40.779656 seconds

No RCU, guarded with RWLOCK

   # INFO:  @ test/lhash_test.c:747
   # multithread stress runs 40000 ops in 36.976926 seconds

Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28677)
crypto/core_namemap.c
crypto/hashtable/hashtable.c
doc/internal/man3/ossl_ht_new.pod
fuzz/hashtable.c
include/internal/hashtable.h
test/lhash_test.c