From 6b24460a408032eca5a50f945f1d1d8a65099bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Mon, 19 Jul 2021 10:17:12 +0200 Subject: [PATCH] Reduce the nodelock count for both cache and regular rbtdb Increasing the nodelock count had major impact on the memory footprint in scenarios where multiple rbtdb structure would be created like hosting many zones in a single server. This reverts commit 03446843856a3efbaaec41409b5eea5542501118 and sets the nodelock count to previously used values. --- lib/dns/rbtdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index ad93de8d3a..98df4377c2 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -336,7 +336,7 @@ typedef ISC_LIST(dns_rbtnode_t) rbtnodelist_t; (((header)->rdh_ttl > (now)) || \ ((header)->rdh_ttl == (now) && ZEROTTL(header))) -#define DEFAULT_NODE_LOCK_COUNT 53 /*%< Should be prime. */ +#define DEFAULT_NODE_LOCK_COUNT 7 /*%< Should be prime. */ #define RBTDB_GLUE_TABLE_INIT_BITS 2U #define RBTDB_GLUE_TABLE_MAX_BITS 32U #define RBTDB_GLUE_TABLE_OVERCOMMIT 3 @@ -368,7 +368,7 @@ hash_32(uint32_t val, unsigned int bits) { #define DEFAULT_CACHE_NODE_LOCK_COUNT DNS_RBTDB_CACHE_NODE_LOCK_COUNT #endif /* if DNS_RBTDB_CACHE_NODE_LOCK_COUNT <= 1 */ #else /* ifdef DNS_RBTDB_CACHE_NODE_LOCK_COUNT */ -#define DEFAULT_CACHE_NODE_LOCK_COUNT 97 +#define DEFAULT_CACHE_NODE_LOCK_COUNT 17 #endif /* DNS_RBTDB_CACHE_NODE_LOCK_COUNT */ typedef struct {