]> 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:32:15 +0000 (13:32 +0200)
commit24ac3392d99bf2d22976290f76ddad4317597349
tree40c90a6217fd5ae487441328b17ac5d19a064da7
parent21c8ba4f0bfe6f0b74681e0373022736d69cb596
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.
lib/isc/mem.c
tests/dns/qpdb_test.c
tests/isc/mem_test.c