]> git.ipfire.org Git - thirdparty/bind9.git/commit
Create a second pruning task for rbtdb with unlimited quantum
authorOndřej Surý <ondrej@isc.org>
Fri, 1 Mar 2024 11:43:15 +0000 (12:43 +0100)
committerMichał Kępień <michal@isc.org>
Wed, 6 Mar 2024 17:43:49 +0000 (18:43 +0100)
commit540a5b5a2c82170acc5c08d2c2ef74a700c7236f
treed4abc3b5612268f5587b2f13a780f72565e55a36
parent12c42a6c07692ae76775bc4602d4c1ccf47ed5ca
Create a second pruning task for rbtdb with unlimited quantum

Previously, rbtdb->task had quantum of 1 because it was originally used
just for freeing RBTDB contents, which can happen on a "best effort"
basis (does not need to be prioritized).  However, when tree pruning was
implemented, it also started sending events to that task, enabling the
latter to become clogged up with a significant event backlog because it
only pruned a single RBTDB node per event.

To prioritize tree pruning (as it is necessary for enforcing the
configured memory use limit for the cache memory context), create a
second task with a virtually unlimited quantum (UINT_MAX) and send the
tree-pruning events to this new task, to ensure that all nodes scheduled
for pruning will be processed before further nodes are queued in a
similar fashion.

This change enables dropping the prunenodes list and restoring the
originally-used logic that allocates and sends a separate event for each
node to prune.

(cherry picked from commit 231b2375e5b9b98096711f5e883911134adb6392)
bin/tests/system/dyndb/driver/db.c
lib/dns/cache.c
lib/dns/db.c
lib/dns/include/dns/db.h
lib/dns/include/dns/rbt.h
lib/dns/rbt.c
lib/dns/rbtdb.c
lib/dns/sdb.c
lib/dns/sdlz.c
lib/dns/zone.c