]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix the isc_hp initialization and memory usage
authorOndřej Surý <ondrej@isc.org>
Tue, 7 Dec 2021 10:15:27 +0000 (11:15 +0100)
committerOndřej Surý <ondrej@isc.org>
Tue, 7 Dec 2021 19:41:46 +0000 (20:41 +0100)
commit15ce1737fa39f8c5e68da5fb7edfd478cbda3a4e
tree72aec5d45266a7b9c2d29e6eadea36e92b73d892
parent5e69cd6329e9d0bca9ca1bc83c1f55fe66cf8db5
Fix the isc_hp initialization and memory usage

Previously, the isc_hp_init() could not lower the value of
isc__hp_max_threads, but because of a mistake the isc__hp_max_threads
would be set to HP_MAX_THREADS (e.g. 128 threads) thus it would be
always set to 128.  This would result in increased memory usage even
when small number of workers were in use.

Change the default value of isc__hp_max_threads to be 1.

Additionally, enforce the max_hps value in isc_hp_new() to be smaller or
equal to HP_MAX_HPS.  The only user is isc_queue which uses just 1
hazard pointer, so it's only theoretical issue.
lib/isc/hp.c