| version 1.137, 2007/11/18 16:27:43 |
version 1.137.2.2, 2007/12/12 22:03:31 |
| Line 77 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| Line 77 __KERNEL_RCSID(0, "$NetBSD$"); |
|
| /* List of all pools */ |
/* List of all pools */ |
| LIST_HEAD(,pool) pool_head = LIST_HEAD_INITIALIZER(pool_head); |
LIST_HEAD(,pool) pool_head = LIST_HEAD_INITIALIZER(pool_head); |
| |
|
| /* List of all caches. */ |
|
| LIST_HEAD(,pool_cache) pool_cache_head = |
|
| LIST_HEAD_INITIALIZER(pool_cache_head); |
|
| |
|
| /* Private pool for page header structures */ |
/* Private pool for page header structures */ |
| #define PHPOOL_MAX 8 |
#define PHPOOL_MAX 8 |
| static struct pool phpool[PHPOOL_MAX]; |
static struct pool phpool[PHPOOL_MAX]; |
| Line 185 static struct pool pcgpool; |
|
| Line 181 static struct pool pcgpool; |
|
| static struct pool cache_pool; |
static struct pool cache_pool; |
| static struct pool cache_cpu_pool; |
static struct pool cache_cpu_pool; |
| |
|
| |
/* List of all caches. */ |
| |
LIST_HEAD(,pool_cache) pool_cache_head = |
| |
LIST_HEAD_INITIALIZER(pool_cache_head); |
| |
|
| |
int pool_cache_disable; |
| |
|
| |
|
| static pool_cache_cpu_t *pool_cache_put_slow(pool_cache_cpu_t *, int *, |
static pool_cache_cpu_t *pool_cache_put_slow(pool_cache_cpu_t *, int *, |
| void *, paddr_t); |
void *, paddr_t); |
| static pool_cache_cpu_t *pool_cache_get_slow(pool_cache_cpu_t *, int *, |
static pool_cache_cpu_t *pool_cache_get_slow(pool_cache_cpu_t *, int *, |
| Line 802 pool_init(struct pool *pp, size_t size, |
|
| Line 805 pool_init(struct pool *pp, size_t size, |
|
| pp->pr_entered_file = NULL; |
pp->pr_entered_file = NULL; |
| pp->pr_entered_line = 0; |
pp->pr_entered_line = 0; |
| |
|
| mutex_init(&pp->pr_lock, MUTEX_DEFAULT, ipl); |
/* |
| |
* XXXAD hack to prevent IP input processing from blocking. |
| |
*/ |
| |
if (ipl == IPL_SOFTNET) { |
| |
mutex_init(&pp->pr_lock, MUTEX_DEFAULT, IPL_VM); |
| |
} else { |
| |
mutex_init(&pp->pr_lock, MUTEX_DEFAULT, ipl); |
| |
} |
| cv_init(&pp->pr_cv, wchan); |
cv_init(&pp->pr_cv, wchan); |
| pp->pr_ipl = ipl; |
pp->pr_ipl = ipl; |
| |
|
| Line 2040 pool_cache_bootstrap(pool_cache_t pc, si |
|
| Line 2050 pool_cache_bootstrap(pool_cache_t pc, si |
|
| palloc = &pool_allocator_nointr; |
palloc = &pool_allocator_nointr; |
| pool_init(pp, size, align, align_offset, flags, wchan, palloc, ipl); |
pool_init(pp, size, align, align_offset, flags, wchan, palloc, ipl); |
| |
|
| mutex_init(&pc->pc_lock, MUTEX_DEFAULT, pp->pr_ipl); |
/* |
| |
* XXXAD hack to prevent IP input processing from blocking. |
| |
*/ |
| |
if (ipl == IPL_SOFTNET) { |
| |
mutex_init(&pc->pc_lock, MUTEX_DEFAULT, IPL_VM); |
| |
} else { |
| |
mutex_init(&pc->pc_lock, MUTEX_DEFAULT, ipl); |
| |
} |
| |
|
| if (ctor == NULL) { |
if (ctor == NULL) { |
| ctor = (int (*)(void *, void *, int))nullop; |
ctor = (int (*)(void *, void *, int))nullop; |
| Line 2576 pool_cache_put_slow(pool_cache_cpu_t *cc |
|
| Line 2593 pool_cache_put_slow(pool_cache_cpu_t *cc |
|
| * If we can't allocate a new group, just throw the |
* If we can't allocate a new group, just throw the |
| * object away. |
* object away. |
| */ |
*/ |
| pcg = pool_get(&pcgpool, PR_NOWAIT); |
if (pool_cache_disable) { |
| |
pcg = NULL; |
| |
} else { |
| |
pcg = pool_get(&pcgpool, PR_NOWAIT); |
| |
} |
| if (pcg == NULL) { |
if (pcg == NULL) { |
| pool_cache_destruct_object(pc, object); |
pool_cache_destruct_object(pc, object); |
| return NULL; |
return NULL; |