]> git.ipfire.org Git - thirdparty/bind9.git/commit
Replace some ADB entry locking with atomics to reduce ADB contention
authorOndřej Surý <ondrej@isc.org>
Thu, 21 Sep 2023 09:59:01 +0000 (11:59 +0200)
committerOndřej Surý <ondrej@isc.org>
Thu, 12 Oct 2023 10:35:00 +0000 (12:35 +0200)
commitcb0db600e78e88ca6e804a95382b2dd99fbbbeb8
tree16dbe7ca8d25b4245025520671ef4116e5411ad8
parent2b20db05e38b7d7ba7f07a45dc286e2ca478b5ed
Replace some ADB entry locking with atomics to reduce ADB contention

Use atomics on couple of ADB entry members (.srtt, .flags, .expires, and
.lastage) to remove ADB entry locking from couple of hot spots.  The
most prominent place is copy_namehook_lists() that gets called under ADB
name lock and if the namehook list is long it acquires-releases quite a
few ADB entry locks.  Changing those ADB entry members to atomics
allowed us to new_adbaddrinfo() not require locked ADB entry and since
adbentry_overquota() already used atomics and handling lame information
was dropped in the previous commit, we could not make the
copy_namehook_lists() lockless.

The other hotspot is dns_adb_adjustsrtt() and dns_adb_agesrtt() that can
now use atomics because .srtt is already atomic_uint.

And the last place that could now use atomics is dns_adb_changeflags().
lib/dns/adb.c