From a6a35373c1c48d240eb5c3b6da5b499f91c19dc5 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Thu, 21 Nov 2019 17:08:06 -0800 Subject: [PATCH] remove unused worker memory pool --- lib/isc/netmgr/netmgr-int.h | 1 - lib/isc/netmgr/netmgr.c | 19 ++++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/lib/isc/netmgr/netmgr-int.h b/lib/isc/netmgr/netmgr-int.h index da4f3ead68..a30d00a576 100644 --- a/lib/isc/netmgr/netmgr-int.h +++ b/lib/isc/netmgr/netmgr-int.h @@ -41,7 +41,6 @@ typedef struct isc__networker { uv_async_t async; /* async channel to send * data to this networker */ isc_mutex_t lock; - isc_mempool_t *mpool_bufs; isc_condition_t cond; bool paused; bool finished; diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 85a0baac43..b8b2b3f01a 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -96,7 +96,7 @@ isc_nm_start(isc_mem_t *mctx, uint32_t workers) { /* * Default TCP timeout values. - * May be updated by isc_nm_listentcp(). + * May be updated by isc_nm_tcptimeouts(). */ mgr->init_timeout = 30000; mgr->idle_timeout = 30000; @@ -122,7 +122,6 @@ isc_nm_start(isc_mem_t *mctx, uint32_t workers) { isc_mutex_init(&worker->lock); isc_condition_init(&worker->cond); - isc_mempool_create(mgr->mctx, 65536, &worker->mpool_bufs); worker->ievents = isc_queue_new(mgr->mctx, 128); /* @@ -182,7 +181,6 @@ nm_destroy(isc_nm_t **mgr0) { int r = uv_loop_close(&mgr->workers[i].loop); INSIST(r == 0); isc_queue_destroy(mgr->workers[i].ievents); - isc_mempool_destroy(&mgr->workers[i].mpool_bufs); } isc_condition_destroy(&mgr->wkstatecond); @@ -388,7 +386,7 @@ nm_thread(void *worker0) { * XXX: uv_run() in UV_RUN_DEFAULT mode returns * zero if there are still active uv_handles. * This shouldn't happen, but if it does, we just - * to keep checking until they're done. We nap for a + * keep checking until they're done. We nap for a * tenth of a second on each loop so as not to burn * CPU. (We do a conditional wait instead, but it * seems like overkill for this case.) @@ -415,21 +413,16 @@ nm_thread(void *worker0) { } /* - * async_cb is an universal callback for 'async' events sent to event loop. - * It's the only way to safely pass data to libuv event loop. We use a single - * async event and a lockless queue of 'isc__netievent_t' structures passed - * from other threads. + * async_cb is a universal callback for 'async' events sent to event loop. + * It's the only way to safely pass data to the libuv event loop. We use a + * single async event and a lockless queue of 'isc__netievent_t' structures + * passed from other threads. */ static void async_cb(uv_async_t *handle) { isc__networker_t *worker = (isc__networker_t *) handle->loop->data; isc__netievent_t *ievent; - /* - * We only try dequeue to not waste time, libuv guarantees - * that if someone calls uv_async_send -after- async_cb was called - * then async_cb will be called again, we won't loose any signals. - */ while ((ievent = (isc__netievent_t *) isc_queue_dequeue(worker->ievents)) != NULL) {