]> git.ipfire.org Git - thirdparty/bind9.git/commit
Make isc_mem_isovermem() probabilistic
authorOndřej Surý <ondrej@isc.org>
Sun, 19 Apr 2026 19:36:43 +0000 (21:36 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 7 May 2026 11:09:18 +0000 (13:09 +0200)
commitddd5586a519dca348e7a454885f674e2ba49db42
tree173b63ca01cfe124466a58030ac29aa88197ddcb
parent4c1547e4b5afabdea3c3fe4ce81eb85acc990c9a
Make isc_mem_isovermem() probabilistic

Replace the hysteretic hi_water/lo_water switch with a stochastic
check: always false below lo_water, always true at or above hi_water,
linearly ramped probability in between.  This spreads cache cleaning
across many inserts instead of triggering a thundering herd once the
hi_water mark is crossed (which causes every addrdataset to enter the
LRU purge path simultaneously and serializes lookups behind the node
write locks).

The is_overmem atomic and its stores are no longer needed and are
removed.  The existing tests that asserted specific hysteretic state
transitions are simplified to check only the deterministic boundaries.

(cherry picked from commit ee24d2a1c3361dcc1c48fb29bb2e0b91bc3405e8)
lib/isc/mem.c
tests/dns/qpdb_test.c
tests/isc/mem_test.c