version 1.87.2.2, 2004/09/18 14:53:03 |
version 1.93, 2004/03/08 22:48:09 |
Line 357 pr_rmpage(struct pool *pp, struct pool_i |
|
Line 357 pr_rmpage(struct pool *pp, struct pool_i |
|
} |
} |
|
|
/* |
/* |
* Initialize all the pools listed in the "pools" link set. |
|
*/ |
|
void |
|
link_pool_init(void) |
|
{ |
|
__link_set_decl(pools, struct link_pool_init); |
|
struct link_pool_init * const *pi; |
|
|
|
__link_set_foreach(pi, pools) |
|
pool_init((*pi)->pp, (*pi)->size, (*pi)->align, |
|
(*pi)->align_offset, (*pi)->flags, (*pi)->wchan, |
|
(*pi)->palloc); |
|
} |
|
|
|
/* |
|
* Initialize the given pool resource structure. |
* Initialize the given pool resource structure. |
* |
* |
* We export this routine to allow other kernel parts to declare |
* We export this routine to allow other kernel parts to declare |
Line 670 pool_get(struct pool *pp, int flags) |
|
Line 655 pool_get(struct pool *pp, int flags) |
|
void *v; |
void *v; |
|
|
#ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
if (__predict_false(pp->pr_itemsperpage == 0)) |
|
panic("pool_get: pool %p: pr_itemsperpage is zero, " |
|
"pool not initialized?", pp); |
|
if (__predict_false(curlwp == NULL && doing_shutdown == 0 && |
if (__predict_false(curlwp == NULL && doing_shutdown == 0 && |
(flags & PR_WAITOK) != 0)) |
(flags & PR_WAITOK) != 0)) |
panic("pool_get: %s: must have NOWAIT", pp->pr_wchan); |
panic("pool_get: %s: must have NOWAIT", pp->pr_wchan); |
Line 975 pool_do_put(struct pool *pp, void *v) |
|
Line 957 pool_do_put(struct pool *pp, void *v) |
|
* If this page is now empty, do one of two things: |
* If this page is now empty, do one of two things: |
* |
* |
* (1) If we have more pages than the page high water mark, |
* (1) If we have more pages than the page high water mark, |
* free the page back to the system. ONLY CONSIDER |
* or if we are flagged as immediately freeing back idle |
|
* pages, free the page back to the system. ONLY CONSIDER |
* FREEING BACK A PAGE IF WE HAVE MORE THAN OUR MINIMUM PAGE |
* FREEING BACK A PAGE IF WE HAVE MORE THAN OUR MINIMUM PAGE |
* CLAIM. |
* CLAIM. |
* |
* |
Line 988 pool_do_put(struct pool *pp, void *v) |
|
Line 971 pool_do_put(struct pool *pp, void *v) |
|
pp->pr_nidle++; |
pp->pr_nidle++; |
if (pp->pr_npages > pp->pr_minpages && |
if (pp->pr_npages > pp->pr_minpages && |
(pp->pr_npages > pp->pr_maxpages || |
(pp->pr_npages > pp->pr_maxpages || |
|
(pp->pr_roflags & PR_IMMEDRELEASE) != 0 || |
(pp->pr_alloc->pa_flags & PA_WANT) != 0)) { |
(pp->pr_alloc->pa_flags & PA_WANT) != 0)) { |
simple_unlock(&pp->pr_slock); |
simple_unlock(&pp->pr_slock); |
pr_rmpage(pp, ph, NULL); |
pr_rmpage(pp, ph, NULL); |