This is a discussion on Re: daemon shutdown time with large zones (bind 9.2.4) within the Bind Users forums, part of the DNS and Related Forums category; >>>>> On Fri, 1 Oct 2004 13:48:42 -0700 (PDT), >>>>> ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
>>>>> On Fri, 1 Oct 2004 13:48:42 -0700 (PDT),
>>>>> Chris Timmons <cwt@networks.cwu.edu> said: > Yes - that is right. The daemon shuts down in ~6:36 now. Hmm, okay. If you have time for an experimental, more-aggressive solution, could you try the attached patch to see how it works (either with or without ISC_MEM_USE_INTERNAL_MALLOC)? It will completely skip freeing actual memory at the shutdown procedure. JINMEI, Tatuya Communication Platform Lab. Corporate R&D Center, Toshiba Corp. jinmei@isl.rdc.toshiba.co.jp diff -r -u bind-9.2.4.orig/bin/named/server.c bind-9.2.4/bin/named/server.c --- bind-9.2.4.orig/bin/named/server.c Fri May 14 10:04:46 2004 +++ bind-9.2.4/bin/named/server.c Sat Oct 2 07:16:24 2004 @@ -2368,6 +2368,7 @@ view = view_next) { view_next = ISC_LIST_NEXT(view, link); ISC_LIST_UNLINK(server->viewlist, view, link); + isc_mem_setshutdown(view->mctx); if (flush) dns_view_flushanddetach(&view); else diff -r -u bind-9.2.4.orig/lib/isc/include/isc/mem.h bind-9.2.4/lib/isc/include/isc/mem.h --- bind-9.2.4.orig/lib/isc/include/isc/mem.h Tue Mar 9 15:11:58 2004 +++ bind-9.2.4/lib/isc/include/isc/mem.h Sat Oct 2 07:16:24 2004 @@ -410,6 +410,8 @@ * limit > 0 */ +void +isc_mem_setshutdown(isc_mem_t *ctx); /* * Pseudo-private functions for use via macros. Do not call directly. diff -r -u bind-9.2.4.orig/lib/isc/mem.c bind-9.2.4/lib/isc/mem.c --- bind-9.2.4.orig/lib/isc/mem.c Tue Mar 9 15:11:48 2004 +++ bind-9.2.4/lib/isc/mem.c Sat Oct 2 07:16:24 2004 @@ -146,6 +146,8 @@ #endif unsigned int memalloc_failures; + + isc_boolean_t shuttingdown; }; #define MEMPOOL_MAGIC ISC_MAGIC('M', 'E', 'M', 'p') @@ -616,7 +618,8 @@ #else UNUSED(size); #endif - (ctx->memfree)(ctx->arg, mem); + if (!ctx->shuttingdown) + (ctx->memfree)(ctx->arg, mem); } /* @@ -1723,4 +1726,13 @@ UNLOCK(mpctx->lock); return (fillcount); +} + +void +isc_mem_setshutdown(isc_mem_t *ctx) { + REQUIRE(VALID_CONTEXT(ctx)); + + LOCK(&ctx->lock); + ctx->shuttingdown = ISC_TRUE; + UNLOCK(&ctx->lock); } |