mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Reduce the number of hazard pointers
Previously, we set the number of the hazard pointers to be 4 times the number of workers because the dispatch ran on the old socket code. Since the old socket code was removed there's a smaller number of threads, namely: - 1 main thread - 1 timer thread - <n> netmgr threads - <n> threadpool threads Set the number of hazard pointers to 2 + 2 * workers.
This commit is contained in:
@@ -27,10 +27,13 @@ isc_managers_create(isc_mem_t *mctx, size_t workers, size_t quantum,
|
|||||||
isc_timermgr_t *timermgr = NULL;
|
isc_timermgr_t *timermgr = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We have ncpus network threads, ncpus old network threads - make
|
* Currently, there are:
|
||||||
* it 4x just to be on the safe side.
|
* - 1 main thread
|
||||||
|
* - 1 timer thread
|
||||||
|
* - n netmgr threads
|
||||||
|
* - n threadpool threads
|
||||||
*/
|
*/
|
||||||
isc_hp_init(4 * workers);
|
isc_hp_init(2 + 2 * workers);
|
||||||
|
|
||||||
REQUIRE(netmgrp != NULL && *netmgrp == NULL);
|
REQUIRE(netmgrp != NULL && *netmgrp == NULL);
|
||||||
isc__netmgr_create(mctx, workers, &netmgr);
|
isc__netmgr_create(mctx, workers, &netmgr);
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
#include <isc/atomic.h>
|
#include <isc/atomic.h>
|
||||||
#include <isc/buffer.h>
|
#include <isc/buffer.h>
|
||||||
#include <isc/condition.h>
|
#include <isc/condition.h>
|
||||||
|
#include <isc/hp.h>
|
||||||
#include <isc/mutex.h>
|
#include <isc/mutex.h>
|
||||||
#include <isc/netmgr.h>
|
#include <isc/netmgr.h>
|
||||||
#include <isc/nonce.h>
|
#include <isc/nonce.h>
|
||||||
@@ -256,6 +257,8 @@ _setup(void **state) {
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isc_hp_init(4 * workers);
|
||||||
|
|
||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
Reference in New Issue
Block a user