| version 1.122.2.2, 2006/10/20 20:03:56 |
version 1.122.2.3, 2007/01/19 20:49:54 |
| Line 53 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| Line 53 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| #include <sys/lock.h> |
#include <sys/lock.h> |
| #include <sys/pool.h> |
#include <sys/pool.h> |
| #include <sys/syslog.h> |
#include <sys/syslog.h> |
| |
#include <sys/debug.h> |
| |
|
| #include <uvm/uvm.h> |
#include <uvm/uvm.h> |
| |
|
| Line 674 pool_init(struct pool *pp, size_t size, |
|
| Line 675 pool_init(struct pool *pp, size_t size, |
|
| pp->pr_hardlimit_warning_last.tv_usec = 0; |
pp->pr_hardlimit_warning_last.tv_usec = 0; |
| pp->pr_drain_hook = NULL; |
pp->pr_drain_hook = NULL; |
| pp->pr_drain_hook_arg = NULL; |
pp->pr_drain_hook_arg = NULL; |
| |
pp->pr_freecheck = NULL; |
| |
|
| /* |
/* |
| * Decide whether to put the page header off page to avoid |
* Decide whether to put the page header off page to avoid |
| Line 1135 pool_get(struct pool *pp, int flags) |
|
| Line 1137 pool_get(struct pool *pp, int flags) |
|
| |
|
| simple_unlock(&pp->pr_slock); |
simple_unlock(&pp->pr_slock); |
| KASSERT((((vaddr_t)v + pp->pr_itemoffset) & (pp->pr_align - 1)) == 0); |
KASSERT((((vaddr_t)v + pp->pr_itemoffset) & (pp->pr_align - 1)) == 0); |
| |
FREECHECK_OUT(&pp->pr_freecheck, v); |
| return (v); |
return (v); |
| } |
} |
| |
|
| Line 1148 pool_do_put(struct pool *pp, void *v, st |
|
| Line 1151 pool_do_put(struct pool *pp, void *v, st |
|
| struct pool_item_header *ph; |
struct pool_item_header *ph; |
| |
|
| LOCK_ASSERT(simple_lock_held(&pp->pr_slock)); |
LOCK_ASSERT(simple_lock_held(&pp->pr_slock)); |
| |
FREECHECK_IN(&pp->pr_freecheck, v); |
| |
|
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| if (__predict_false(pp->pr_nout == 0)) { |
if (__predict_false(pp->pr_nout == 0)) { |
| Line 2080 pool_cache_get_paddr(struct pool_cache * |
|
| Line 2084 pool_cache_get_paddr(struct pool_cache * |
|
| *pap = POOL_PADDR_INVALID; |
*pap = POOL_PADDR_INVALID; |
| #endif |
#endif |
| } |
} |
| |
|
| |
FREECHECK_OUT(&pc->pc_freecheck, object); |
| return (object); |
return (object); |
| } |
} |
| |
|
| Line 2095 pool_cache_get_paddr(struct pool_cache * |
|
| Line 2101 pool_cache_get_paddr(struct pool_cache * |
|
| |
|
| KASSERT((((vaddr_t)object + pc->pc_pool->pr_itemoffset) & |
KASSERT((((vaddr_t)object + pc->pc_pool->pr_itemoffset) & |
| (pc->pc_pool->pr_align - 1)) == 0); |
(pc->pc_pool->pr_align - 1)) == 0); |
| |
FREECHECK_OUT(&pc->pc_freecheck, object); |
| return (object); |
return (object); |
| } |
} |
| |
|
| Line 2110 pool_cache_put_paddr(struct pool_cache * |
|
| Line 2117 pool_cache_put_paddr(struct pool_cache * |
|
| struct pool_cache_group *pcg; |
struct pool_cache_group *pcg; |
| int s; |
int s; |
| |
|
| |
FREECHECK_IN(&pc->pc_freecheck, object); |
| |
|
| if (__predict_false((pc->pc_pool->pr_flags & PR_WANTED) != 0)) { |
if (__predict_false((pc->pc_pool->pr_flags & PR_WANTED) != 0)) { |
| goto destruct; |
goto destruct; |
| } |
} |