version 1.4, 1998/07/24 20:19:23 |
version 1.6, 1998/08/01 23:44:21 |
|
|
*/ |
*/ |
|
|
/* List of all pools */ |
/* List of all pools */ |
static TAILQ_HEAD(,pool) pool_head = TAILQ_HEAD_INITIALIZER(pool_head); |
TAILQ_HEAD(,pool) pool_head = TAILQ_HEAD_INITIALIZER(pool_head); |
|
|
/* Private pool for page header structures */ |
/* Private pool for page header structures */ |
static struct pool phpool; |
static struct pool phpool; |
Line 233 pr_rmpage(pp, ph) |
|
Line 233 pr_rmpage(pp, ph) |
|
pp->pr_npages--; |
pp->pr_npages--; |
pp->pr_npagefree++; |
pp->pr_npagefree++; |
|
|
|
if (ph->ph_nmissing == 0) { |
|
#ifdef DIAGNOSTIC |
|
if (pp->pr_nidle == 0) |
|
panic("pr_rmpage: nidle inconsistent"); |
|
#endif |
|
pp->pr_nidle--; |
|
} |
|
|
if ((pp->pr_flags & PR_PHINPAGE) == 0) { |
if ((pp->pr_flags & PR_PHINPAGE) == 0) { |
LIST_REMOVE(ph, ph_hashlist); |
LIST_REMOVE(ph, ph_hashlist); |
pool_put(&phpool, ph); |
pool_put(&phpool, ph); |
|
|
* Remove from item list. |
* Remove from item list. |
*/ |
*/ |
TAILQ_REMOVE(&ph->ph_itemlist, pi, pi_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++; |
ph->ph_nmissing++; |
if (TAILQ_FIRST(&ph->ph_itemlist) == NULL) { |
if (TAILQ_FIRST(&ph->ph_itemlist) == NULL) { |
/* |
/* |
|
|
* If this page has just become un-empty, move it the head. |
* If this page has just become un-empty, move it the head. |
*/ |
*/ |
if (ph->ph_nmissing == 0) { |
if (ph->ph_nmissing == 0) { |
|
pp->pr_nidle++; |
if (pp->pr_npages > pp->pr_maxpages) { |
if (pp->pr_npages > pp->pr_maxpages) { |
#if 0 |
#if 0 |
timeout(pool_drain, 0, pool_inactive_time*hz); |
timeout(pool_drain, 0, pool_inactive_time*hz); |
Line 730 pool_prime_page(pp, storage) |
|
Line 746 pool_prime_page(pp, storage) |
|
ph->ph_nmissing = 0; |
ph->ph_nmissing = 0; |
ph->ph_time.tv_sec = ph->ph_time.tv_usec = 0; |
ph->ph_time.tv_sec = ph->ph_time.tv_usec = 0; |
|
|
|
pp->pr_nidle++; |
|
|
/* |
/* |
* Color this page. |
* Color this page. |
*/ |
*/ |
Line 905 pool_print(pp, label) |
|
Line 923 pool_print(pp, label) |
|
printf("%s: ", label); |
printf("%s: ", label); |
|
|
printf("pool %s: nalloc %lu nfree %lu npagealloc %lu npagefree %lu\n" |
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_wchan, |
pp->pr_nget, |
pp->pr_nget, |
pp->pr_nput, |
pp->pr_nput, |
Line 914 pool_print(pp, label) |
|
Line 933 pool_print(pp, label) |
|
pp->pr_npages, |
pp->pr_npages, |
pp->pr_minitems, |
pp->pr_minitems, |
pp->pr_itemsperpage, |
pp->pr_itemsperpage, |
pp->pr_itemoffset); |
pp->pr_itemoffset, |
|
pp->pr_nidle); |
} |
} |
|
|
int |
int |