mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 07:42:07 -04:00
[9.20] fix: usr: Apply the memory limit only to ADB database items
Resolver under heavy-load could exhaust the memory available for storing the information in the Address Database (ADB) effectively evicting already stored information in the ADB. The memory used to retrieve and provide information from the ADB is now not a subject of the same memory limits that are applied for storing the information in the Address Database. Closes #5127 Backport of MR !9954 Merge branch 'backport-5127-change-ADB-memory-split-9.20' into 'bind-9.20' See merge request isc-projects/bind9!9975
This commit is contained in:
commit
0ab22458f5
1 changed files with 7 additions and 7 deletions
|
|
@ -1114,7 +1114,7 @@ static dns_adbfind_t *
|
|||
new_adbfind(dns_adb_t *adb, in_port_t port) {
|
||||
dns_adbfind_t *find = NULL;
|
||||
|
||||
find = isc_mem_get(adb->mctx, sizeof(*find));
|
||||
find = isc_mem_get(adb->hmctx, sizeof(*find));
|
||||
*find = (dns_adbfind_t){
|
||||
.port = port,
|
||||
.result_v4 = ISC_R_UNEXPECTED,
|
||||
|
|
@ -1153,7 +1153,7 @@ free_adbfind(dns_adbfind_t **findp) {
|
|||
|
||||
isc_mutex_destroy(&find->lock);
|
||||
|
||||
isc_mem_put(adb->mctx, find, sizeof(*find));
|
||||
isc_mem_put(adb->hmctx, find, sizeof(*find));
|
||||
dns_adb_detach(&adb);
|
||||
}
|
||||
|
||||
|
|
@ -1161,7 +1161,7 @@ static dns_adbfetch_t *
|
|||
new_adbfetch(dns_adb_t *adb) {
|
||||
dns_adbfetch_t *fetch = NULL;
|
||||
|
||||
fetch = isc_mem_get(adb->mctx, sizeof(*fetch));
|
||||
fetch = isc_mem_get(adb->hmctx, sizeof(*fetch));
|
||||
*fetch = (dns_adbfetch_t){ 0 };
|
||||
dns_rdataset_init(&fetch->rdataset);
|
||||
|
||||
|
|
@ -1185,7 +1185,7 @@ free_adbfetch(dns_adb_t *adb, dns_adbfetch_t **fetchp) {
|
|||
dns_rdataset_disassociate(&fetch->rdataset);
|
||||
}
|
||||
|
||||
isc_mem_put(adb->mctx, fetch, sizeof(*fetch));
|
||||
isc_mem_put(adb->hmctx, fetch, sizeof(*fetch));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1196,7 +1196,7 @@ static dns_adbaddrinfo_t *
|
|||
new_adbaddrinfo(dns_adb_t *adb, dns_adbentry_t *entry, in_port_t port) {
|
||||
dns_adbaddrinfo_t *ai = NULL;
|
||||
|
||||
ai = isc_mem_get(adb->mctx, sizeof(*ai));
|
||||
ai = isc_mem_get(adb->hmctx, sizeof(*ai));
|
||||
*ai = (dns_adbaddrinfo_t){
|
||||
.srtt = atomic_load(&entry->srtt),
|
||||
.flags = atomic_load(&entry->flags),
|
||||
|
|
@ -1229,7 +1229,7 @@ free_adbaddrinfo(dns_adb_t *adb, dns_adbaddrinfo_t **ainfo) {
|
|||
}
|
||||
dns_adbentry_detach(&ai->entry);
|
||||
|
||||
isc_mem_put(adb->mctx, ai, sizeof(*ai));
|
||||
isc_mem_put(adb->hmctx, ai, sizeof(*ai));
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -1866,7 +1866,7 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, dns_adb_t **newadb) {
|
|||
isc_mem_attach(mem, &adb->mctx);
|
||||
|
||||
isc_mem_create(&adb->hmctx);
|
||||
isc_mem_setname(adb->hmctx, "ADB_hashmaps");
|
||||
isc_mem_setname(adb->hmctx, "ADB_dynamic");
|
||||
|
||||
isc_hashmap_create(adb->hmctx, ADB_HASH_BITS, &adb->names);
|
||||
isc_rwlock_init(&adb->names_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue