version 1.25, 1999/05/10 21:13:05 |
version 1.29, 1999/08/05 04:00:04 |
|
|
|
|
#include "opt_pool.h" |
#include "opt_pool.h" |
#include "opt_poollog.h" |
#include "opt_poollog.h" |
|
#include "opt_lockdebug.h" |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/systm.h> |
#include <sys/systm.h> |
Line 313 pr_rmpage(pp, ph) |
|
Line 314 pr_rmpage(pp, ph) |
|
pp->pr_npagefree++; |
pp->pr_npagefree++; |
|
|
if ((pp->pr_roflags & PR_PHINPAGE) == 0) { |
if ((pp->pr_roflags & PR_PHINPAGE) == 0) { |
|
int s; |
LIST_REMOVE(ph, ph_hashlist); |
LIST_REMOVE(ph, ph_hashlist); |
|
s = splhigh(); |
pool_put(&phpool, ph); |
pool_put(&phpool, ph); |
|
splx(s); |
} |
} |
|
|
if (pp->pr_curpage == ph) { |
if (pp->pr_curpage == ph) { |
Line 603 _pool_get(pp, flags, file, line) |
|
Line 607 _pool_get(pp, flags, file, line) |
|
} |
} |
#endif |
#endif |
if (pp->pr_nout == pp->pr_hardlimit) { |
if (pp->pr_nout == pp->pr_hardlimit) { |
if (flags & PR_WAITOK) { |
if ((flags & PR_WAITOK) && !(flags & PR_LIMITFAIL)) { |
/* |
/* |
* XXX: A warning isn't logged in this case. Should |
* XXX: A warning isn't logged in this case. Should |
* it be? |
* it be? |
Line 834 _pool_put(pp, v, file, line) |
|
Line 838 _pool_put(pp, v, file, line) |
|
panic("pool_put: %s: page header missing", pp->pr_wchan); |
panic("pool_put: %s: page header missing", pp->pr_wchan); |
} |
} |
|
|
|
#ifdef LOCKDEBUG |
|
/* |
|
* Check if we're freeing a locked simple lock. |
|
*/ |
|
simple_lock_freecheck((caddr_t)pi, ((caddr_t)pi) + pp->pr_size); |
|
#endif |
|
|
/* |
/* |
* Return to item list. |
* Return to item list. |
*/ |
*/ |
Line 966 pool_prime(pp, n, storage) |
|
Line 977 pool_prime(pp, n, storage) |
|
return (ENOMEM); |
return (ENOMEM); |
} |
} |
|
|
|
pp->pr_npagealloc++; |
pool_prime_page(pp, cp); |
pool_prime_page(pp, cp); |
pp->pr_minpages++; |
pp->pr_minpages++; |
} |
} |
Line 994 pool_prime_page(pp, storage) |
|
Line 1006 pool_prime_page(pp, storage) |
|
caddr_t cp = storage; |
caddr_t cp = storage; |
unsigned int align = pp->pr_align; |
unsigned int align = pp->pr_align; |
unsigned int ioff = pp->pr_itemoffset; |
unsigned int ioff = pp->pr_itemoffset; |
int n; |
int s, n; |
|
|
if ((pp->pr_roflags & PR_PHINPAGE) != 0) { |
if ((pp->pr_roflags & PR_PHINPAGE) != 0) { |
ph = (struct pool_item_header *)(cp + pp->pr_phoffset); |
ph = (struct pool_item_header *)(cp + pp->pr_phoffset); |
} else { |
} else { |
|
s = splhigh(); |
ph = pool_get(&phpool, PR_URGENT); |
ph = pool_get(&phpool, PR_URGENT); |
|
splx(s); |
LIST_INSERT_HEAD(&pp->pr_hashtab[PR_HASH_INDEX(pp, cp)], |
LIST_INSERT_HEAD(&pp->pr_hashtab[PR_HASH_INDEX(pp, cp)], |
ph, ph_hashlist); |
ph, ph_hashlist); |
} |
} |
Line 1100 pool_catchup(pp) |
|
Line 1114 pool_catchup(pp) |
|
error = ENOMEM; |
error = ENOMEM; |
break; |
break; |
} |
} |
|
pp->pr_npagealloc++; |
pool_prime_page(pp, cp); |
pool_prime_page(pp, cp); |
} |
} |
|
|