Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/subr_pool.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/subr_pool.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.5 retrieving revision 1.7 diff -u -p -r1.5 -r1.7 --- src/sys/kern/subr_pool.c 1998/07/31 21:55:09 1.5 +++ src/sys/kern/subr_pool.c 1998/08/02 04:34:46 1.7 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pool.c,v 1.5 1998/07/31 21:55:09 thorpej Exp $ */ +/* $NetBSD: subr_pool.c,v 1.7 1998/08/02 04:34:46 thorpej Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -226,6 +226,17 @@ pr_rmpage(pp, ph) { /* + * If the page was idle, decrement the idle page count. + */ + if (ph->ph_nmissing == 0) { +#ifdef DIAGNOSTIC + if (pp->pr_nidle == 0) + panic("pr_rmpage: nidle inconsistent"); +#endif + pp->pr_nidle--; + } + + /* * Unlink a page from the pool and release it. */ TAILQ_REMOVE(&pp->pr_pagelist, ph, ph_pagelist); @@ -541,6 +552,13 @@ again: * Remove from item list. */ TAILQ_REMOVE(&ph->ph_itemlist, pi, pi_list); + if (ph->ph_nmissing == 0) { +#ifdef DIAGNOSTIC + if (pp->pr_nidle == 0) + panic("pool_get: nidle inconsistent"); +#endif + pp->pr_nidle--; + } ph->ph_nmissing++; if (TAILQ_FIRST(&ph->ph_itemlist) == NULL) { /* @@ -623,6 +641,7 @@ pool_put(pp, v) * If this page has just become un-empty, move it the head. */ if (ph->ph_nmissing == 0) { + pp->pr_nidle++; if (pp->pr_npages > pp->pr_maxpages) { #if 0 timeout(pool_drain, 0, pool_inactive_time*hz); @@ -730,6 +749,8 @@ pool_prime_page(pp, storage) ph->ph_nmissing = 0; ph->ph_time.tv_sec = ph->ph_time.tv_usec = 0; + pp->pr_nidle++; + /* * Color this page. */ @@ -905,7 +926,8 @@ pool_print(pp, label) printf("%s: ", label); printf("pool %s: nalloc %lu nfree %lu npagealloc %lu npagefree %lu\n" - " npages %u minitems %u itemsperpage %u itemoffset %u\n", + " npages %u minitems %u itemsperpage %u itemoffset %u\n" + " nidle %lu\n", pp->pr_wchan, pp->pr_nget, pp->pr_nput, @@ -914,7 +936,8 @@ pool_print(pp, label) pp->pr_npages, pp->pr_minitems, pp->pr_itemsperpage, - pp->pr_itemoffset); + pp->pr_itemoffset, + pp->pr_nidle); } int