| version 1.151, 2008/02/14 11:45:24 |
version 1.151.6.1, 2008/04/03 12:43:03 |
| Line 612 pool_subsystem_init(void) |
|
| Line 612 pool_subsystem_init(void) |
|
| pa_reclaim_register(pa); |
pa_reclaim_register(pa); |
| } |
} |
| |
|
| pool_init(&cache_pool, sizeof(struct pool_cache), CACHE_LINE_SIZE, |
pool_init(&cache_pool, sizeof(struct pool_cache), coherency_unit, |
| 0, 0, "pcache", &pool_allocator_nointr, IPL_NONE); |
0, 0, "pcache", &pool_allocator_nointr, IPL_NONE); |
| |
|
| pool_init(&cache_cpu_pool, sizeof(pool_cache_cpu_t), CACHE_LINE_SIZE, |
pool_init(&cache_cpu_pool, sizeof(pool_cache_cpu_t), coherency_unit, |
| 0, 0, "pcachecpu", &pool_allocator_nointr, IPL_NONE); |
0, 0, "pcachecpu", &pool_allocator_nointr, IPL_NONE); |
| } |
} |
| |
|
| Line 855 pool_init(struct pool *pp, size_t size, |
|
| Line 855 pool_init(struct pool *pp, size_t size, |
|
| |
|
| size = sizeof(pcg_t) + |
size = sizeof(pcg_t) + |
| (PCG_NOBJECTS_NORMAL - 1) * sizeof(pcgpair_t); |
(PCG_NOBJECTS_NORMAL - 1) * sizeof(pcgpair_t); |
| pool_init(&pcg_normal_pool, size, CACHE_LINE_SIZE, 0, 0, |
pool_init(&pcg_normal_pool, size, coherency_unit, 0, 0, |
| "pcgnormal", &pool_allocator_meta, IPL_VM); |
"pcgnormal", &pool_allocator_meta, IPL_VM); |
| |
|
| size = sizeof(pcg_t) + |
size = sizeof(pcg_t) + |
| (PCG_NOBJECTS_LARGE - 1) * sizeof(pcgpair_t); |
(PCG_NOBJECTS_LARGE - 1) * sizeof(pcgpair_t); |
| pool_init(&pcg_large_pool, size, CACHE_LINE_SIZE, 0, 0, |
pool_init(&pcg_large_pool, size, coherency_unit, 0, 0, |
| "pcglarge", &pool_allocator_meta, IPL_VM); |
"pcglarge", &pool_allocator_meta, IPL_VM); |
| } |
} |
| |
|
| Line 995 pool_get(struct pool *pp, int flags) |
|
| Line 995 pool_get(struct pool *pp, int flags) |
|
| |
|
| #endif /* DIAGNOSTIC */ |
#endif /* DIAGNOSTIC */ |
| #ifdef LOCKDEBUG |
#ifdef LOCKDEBUG |
| if (flags & PR_WAITOK) |
if (flags & PR_WAITOK) { |
| ASSERT_SLEEPABLE(NULL, "pool_get(PR_WAITOK)"); |
ASSERT_SLEEPABLE(); |
| |
} |
| #endif |
#endif |
| |
|
| mutex_enter(&pp->pr_lock); |
mutex_enter(&pp->pr_lock); |
| Line 1288 pool_do_put(struct pool *pp, void *v, st |
|
| Line 1289 pool_do_put(struct pool *pp, void *v, st |
|
| if (ph->ph_nmissing == 0) { |
if (ph->ph_nmissing == 0) { |
| 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) { |
| pa_starved_p(pp->pr_alloc))) { |
|
| pr_rmpage(pp, ph, pq); |
pr_rmpage(pp, ph, pq); |
| } else { |
} else { |
| LIST_REMOVE(ph, ph_pagelist); |
LIST_REMOVE(ph, ph_pagelist); |
| Line 2206 pool_cache_cpu_init1(struct cpu_info *ci |
|
| Line 2206 pool_cache_cpu_init1(struct cpu_info *ci |
|
| index = ci->ci_index; |
index = ci->ci_index; |
| |
|
| KASSERT(index < MAXCPUS); |
KASSERT(index < MAXCPUS); |
| KASSERT(((uintptr_t)pc->pc_cpus & (CACHE_LINE_SIZE - 1)) == 0); |
|
| |
|
| if ((cc = pc->pc_cpus[index]) != NULL) { |
if ((cc = pc->pc_cpus[index]) != NULL) { |
| KASSERT(cc->cc_cpuindex == index); |
KASSERT(cc->cc_cpuindex == index); |
| Line 2399 pool_cache_cpu_enter(pool_cache_t pc, in |
|
| Line 2398 pool_cache_cpu_enter(pool_cache_t pc, in |
|
| if (cc->cc_ipl != IPL_NONE) { |
if (cc->cc_ipl != IPL_NONE) { |
| *s = splraiseipl(cc->cc_iplcookie); |
*s = splraiseipl(cc->cc_iplcookie); |
| } |
} |
| KASSERT(((uintptr_t)cc & (CACHE_LINE_SIZE - 1)) == 0); |
|
| |
|
| return cc; |
return cc; |
| } |
} |
| Line 2522 pool_cache_get_paddr(pool_cache_t pc, in |
|
| Line 2520 pool_cache_get_paddr(pool_cache_t pc, in |
|
| int s; |
int s; |
| |
|
| #ifdef LOCKDEBUG |
#ifdef LOCKDEBUG |
| if (flags & PR_WAITOK) |
if (flags & PR_WAITOK) { |
| ASSERT_SLEEPABLE(NULL, "pool_cache_get(PR_WAITOK)"); |
ASSERT_SLEEPABLE(); |
| |
} |
| #endif |
#endif |
| |
|
| cc = pool_cache_cpu_enter(pc, &s); |
cc = pool_cache_cpu_enter(pc, &s); |
|
|
| snprintf(cpucachestr, |
snprintf(cpucachestr, |
| sizeof(cpucachestr), |
sizeof(cpucachestr), |
| "cached by CPU %u", |
"cached by CPU %u", |
| (u_int)ci->ci_cpuid); |
ci->ci_index); |
| goto print; |
goto print; |
| } |
} |
| } |
} |