bind9/bin/dnssec
alessio d21f63884a Adaptive memory allocation strategy for qp-tries
qp-tries allocate their nodes (twigs) in chunks to reduce allocator
pressure and improve memory locality. The choice of chunk size presents
a tradeoff: larger chunks benefit qp-tries with many values (as seen
in large zones and resolvers) but waste memory in smaller use cases.

Previously, our fixed chunk size of 2^10 twigs meant that even an
empty qp-trie would consume 12KB of memory, while reducing this size
would negatively impact resolver performance.

This commit implements an adaptive chunking strategy that:
 - Tracks the size of the most recently allocated chunk.
 - Doubles the chunk size for each new allocation until reaching a
   predefined maximum.

This approach effectively balances memory efficiency for small tries
while maintaining the performance benefits of larger chunk sizes for
bigger data structures.

This commit also splits the callback freeing qpmultis into two
phases, one that frees the underlying qptree, and one that reclaims
the qpmulti memory. In order to prevent races between the qpmulti
destructor and chunk garbage collection jobs, the second phase is
protected by reference counting.

(cherry picked from commit 70b1777d8a)
2025-08-05 12:48:19 +02:00
..
.gitignore Introduce new DNSSEC tool dnssec-ksr 2024-04-19 10:41:04 +02:00
dnssec-cds.c Adaptive memory allocation strategy for qp-tries 2025-08-05 12:48:19 +02:00
dnssec-cds.rst Add internal hyperlinks to See Also section of manual pages 2022-03-14 10:46:36 +01:00
dnssec-dsfromkey.c Adaptive memory allocation strategy for qp-tries 2025-08-05 12:48:19 +02:00
dnssec-dsfromkey.rst Update man pages for deprecated algorithms 2025-07-16 01:40:00 +10:00
dnssec-importkey.c Adaptive memory allocation strategy for qp-tries 2025-08-05 12:48:19 +02:00
dnssec-importkey.rst Teach dnssec-settime to read unset times that it writes 2022-05-17 16:28:40 +02:00
dnssec-keyfromlabel.c Warn about deprecated DNSKEY and DS algorithms / digest types 2025-07-16 01:39:58 +10:00
dnssec-keyfromlabel.rst Update man pages for deprecated algorithms 2025-07-16 01:40:00 +10:00
dnssec-keygen.c Warn about deprecated DNSKEY and DS algorithms / digest types 2025-07-16 01:39:58 +10:00
dnssec-keygen.rst Update man pages for deprecated algorithms 2025-07-16 01:40:00 +10:00
dnssec-ksr.c Use clang-format-20 to update formatting 2025-06-25 13:32:08 +10:00
dnssec-ksr.rst dnssec-ksr keygen -o to create KSKs 2024-11-04 01:10:34 +00:00
dnssec-revoke.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
dnssec-revoke.rst Add internal hyperlinks to See Also section of manual pages 2022-03-14 10:46:36 +01:00
dnssec-settime.c Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
dnssec-settime.rst Remove trailing whitespace from all text files 2023-06-13 15:05:40 +02:00
dnssec-signzone.c Adaptive memory allocation strategy for qp-tries 2025-08-05 12:48:19 +02:00
dnssec-signzone.rst Fix broken links in documentation 2025-01-27 09:42:47 +00:00
dnssec-verify.c Adaptive memory allocation strategy for qp-tries 2025-08-05 12:48:19 +02:00
dnssec-verify.rst Document new -J option for dnssec-signzone and dnssec-verify 2024-07-08 14:53:01 +02:00
dnssectool.c Apply more SET_IF_NOT_NULL() changes 2024-12-13 13:50:05 +00:00
dnssectool.h Add restrict key tag range support 2024-08-23 07:42:21 +10:00
Makefile.am Move common create key functions to dnssectool.c 2024-04-19 10:41:04 +02:00