]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use lock-free hashtable for storing resolver fetch contexts
authorOndřej Surý <ondrej@isc.org>
Wed, 17 Sep 2025 13:08:10 +0000 (15:08 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 23 Sep 2025 22:08:21 +0000 (00:08 +0200)
commit6011fb5484ca3693f453ec7dacb0c8761fc2395f
tree1c6a94ff5e53f86030e347c31f1ccd08eb86db2b
parenta20c8fe74b0af24ed274ff1f8a1908f164e0e9d4
Use lock-free hashtable for storing resolver fetch contexts

Previously, the fetch contexts were stored inside rwlocked hashmap
table.  This was one of the most contended places for the resolver,
especially in the cold cache situation.

Replace the locked hashmap with the lock-free hashtable from the RCU
library and protect the fetch contexts against reuse by replacing the
libisc reference counting with urcu_ref that can soft-fail in situation
where the reference count is already zero.  This allows us to easily
skip re-using the fetch context if it is already in process of being
destroyed.
lib/dns/resolver.c
lib/isc/include/isc/urcu.h