Improve the badcache cleaning by adding LRU and using RCU

Instead of cleaning the dns_badcache opportunistically, add per-loop
LRU, so each thread-loop can clean the expired entries.  This also
allows removal of the atomic operations as the badcache entries are now
immutable, instead of updating the badcache entry in place, the old
entry is now deleted from the hashtable and the LRU list, and the new
entry is inserted in the LRU.
This commit is contained in:
Ondřej Surý
2024-11-14 19:51:29 +01:00
parent d94e88220c
commit 2cb5a6210f
16 changed files with 291 additions and 208 deletions

View File

@@ -173,7 +173,8 @@ LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
isc_loopmgr_create(mctx, 1, &loopmgr);
result = dns_view_create(mctx, NULL, dns_rdataclass_in, "view", &view);
result = dns_view_create(mctx, loopmgr, NULL, dns_rdataclass_in, "view",
&view);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "dns_view_create failed: %s\n",
isc_result_totext(result));