From: Alessio Podda Date: Wed, 9 Jul 2025 14:17:02 +0000 (+0000) Subject: chg: dev: Replace per-zone lock buckets with global buckets X-Git-Tag: v9.21.11~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0d1d936de8f6de43b4df916cae10331731a3f19;p=thirdparty%2Fbind9.git chg: dev: Replace per-zone lock buckets with global buckets Qpzone employs a locking strategy where rwlocks are grouped into buckets, and each zone gets 17 buckets. This strategy is suboptimal in two ways: - If named is serving a single zone or a zone is the majority of the traffic, this strategy pretty much guarantees contention when using more than a dozen threads. - If named is serving many small zones, it causes substantial memory usage. This commit switches the locking to a global table initialized at start time. This should have three effects: - Performance should improve in the single zone case, since now we are selecting from a bigger pool of locks. - Memory consumption should go down significantly in the many zone cases. - Performance should not degrade substantially in the many zone cases. The reason for this is that, while we could have substantially more zones than locks, we can query/edit only O(num threads) at the same time. So by making the global table much bigger than the expected number of threads, we can limit contention. Merge branch 'alessio/global-qpzone-lock-table' into 'main' See merge request isc-projects/bind9!10446 --- e0d1d936de8f6de43b4df916cae10331731a3f19