]> git.ipfire.org Git - thirdparty/bind9.git/commit
Add low contention stats counter
authorAlessio Podda <alessio@isc.org>
Fri, 5 Sep 2025 13:39:48 +0000 (15:39 +0200)
committerAlessio Podda <alessio@isc.org>
Thu, 26 Mar 2026 09:19:25 +0000 (10:19 +0100)
commited0ecb62e4ed262e8a9575f2381f2a709297a1f2
treea99b5374a486fe837d45bfaff5a79e5bf193aca8
parent9911743d6ac0eec6a2f7e8687fc47ac4a5d6f62c
Add low contention stats counter

In the current statistics counter implementation, the statistics are
backed by an array of counters, which are updated via atomic operations.
This leads to contention, especially on high core count
machines.

This commit introduces a new isc_statsmulti_t counter that keeps a
separate array per thread. These counters are then aggregated only when
statistics are queried, shifting work off the critical path.

These changes lead to a ~2% improvement in perflab.
20 files changed:
bin/delv/delv.c
bin/named/server.c
bin/named/statschannel.c
bin/named/zoneconf.c
lib/dns/include/dns/resolver.h
lib/dns/include/dns/stats.h
lib/dns/include/dns/zone.h
lib/dns/resolver.c
lib/dns/stats.c
lib/dns/zone.c
lib/isc/include/isc/statsmulti.h [new file with mode: 0644]
lib/isc/meson.build
lib/isc/statsmulti.c [new file with mode: 0644]
lib/ns/client.c
lib/ns/include/ns/server.h
lib/ns/include/ns/stats.h
lib/ns/query.c
lib/ns/server.c
lib/ns/stats.c
tests/isc/stats_test.c