]> git.ipfire.org Git - thirdparty/bind9.git/commit
Reduce lock contention during RBTDB tree pruning
authorOndřej Surý <ondrej@isc.org>
Wed, 21 Feb 2024 10:45:36 +0000 (11:45 +0100)
committerOndřej Surý <ondrej@isc.org>
Thu, 29 Feb 2024 10:23:03 +0000 (11:23 +0100)
commiteed17611d8ceeb99ec3ff282aaea4d38bd334932
treeb3f50769a343a29979eb32361371e51d5d946247
parent264a3a92b2cad478330e6f1d7879bd11bb377d2e
Reduce lock contention during RBTDB tree pruning

The log message for commit 24381cc36d8528f5a4046fb2614451aeac4cdfc1
explained:

    In some older BIND 9 branches, the extra queuing overhead eliminated by
    this change could be remotely exploited to cause excessive memory use.
    Due to architectural shift, this branch is not vulnerable to that issue,
    but applying the fix to the latter is nevertheless deemed prudent for
    consistency and to make the code future-proof.

However, it turned out that having a single queue for the nodes to be
pruned increased lock contention to a level where cleaning up nodes from
the RBTDB took too long, causing the amount of memory used by the cache
to grow indefinitely over time.

This commit reverts the change to the pruning mechanism introduced by
commit 24381cc36d8528f5a4046fb2614451aeac4cdfc1 as BIND branches newer
than 9.16 were not affected by the excessive event queueing overhead
issue mentioned in the log message for the above commit.
lib/dns/include/dns/rbt.h
lib/dns/rbt.c
lib/dns/rbtdb.c
lib/dns/rbtdb_p.h