Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/subr_pool.c,v retrieving revision 1.151 retrieving revision 1.151.6.1 diff -u -p -r1.151 -r1.151.6.1 --- src/sys/kern/subr_pool.c 2008/02/14 11:45:24 1.151 +++ src/sys/kern/subr_pool.c 2008/04/03 12:43:03 1.151.6.1 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pool.c,v 1.151 2008/02/14 11:45:24 yamt Exp $ */ +/* $NetBSD: subr_pool.c,v 1.151.6.1 2008/04/03 12:43:03 mjf Exp $ */ /*- * Copyright (c) 1997, 1999, 2000, 2002, 2007 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.151 2008/02/14 11:45:24 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.151.6.1 2008/04/03 12:43:03 mjf Exp $"); #include "opt_ddb.h" #include "opt_pool.h" @@ -612,10 +612,10 @@ pool_subsystem_init(void) 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); - 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); } @@ -855,12 +855,12 @@ pool_init(struct pool *pp, size_t size, size = sizeof(pcg_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); size = sizeof(pcg_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); } @@ -995,8 +995,9 @@ pool_get(struct pool *pp, int flags) #endif /* DIAGNOSTIC */ #ifdef LOCKDEBUG - if (flags & PR_WAITOK) - ASSERT_SLEEPABLE(NULL, "pool_get(PR_WAITOK)"); + if (flags & PR_WAITOK) { + ASSERT_SLEEPABLE(); + } #endif mutex_enter(&pp->pr_lock); @@ -1288,8 +1289,7 @@ pool_do_put(struct pool *pp, void *v, st if (ph->ph_nmissing == 0) { pp->pr_nidle++; if (pp->pr_npages > pp->pr_minpages && - (pp->pr_npages > pp->pr_maxpages || - pa_starved_p(pp->pr_alloc))) { + pp->pr_npages > pp->pr_maxpages) { pr_rmpage(pp, ph, pq); } else { LIST_REMOVE(ph, ph_pagelist); @@ -2206,7 +2206,6 @@ pool_cache_cpu_init1(struct cpu_info *ci index = ci->ci_index; KASSERT(index < MAXCPUS); - KASSERT(((uintptr_t)pc->pc_cpus & (CACHE_LINE_SIZE - 1)) == 0); if ((cc = pc->pc_cpus[index]) != NULL) { KASSERT(cc->cc_cpuindex == index); @@ -2399,7 +2398,6 @@ pool_cache_cpu_enter(pool_cache_t pc, in if (cc->cc_ipl != IPL_NONE) { *s = splraiseipl(cc->cc_iplcookie); } - KASSERT(((uintptr_t)cc & (CACHE_LINE_SIZE - 1)) == 0); return cc; } @@ -2522,8 +2520,9 @@ pool_cache_get_paddr(pool_cache_t pc, in int s; #ifdef LOCKDEBUG - if (flags & PR_WAITOK) - ASSERT_SLEEPABLE(NULL, "pool_cache_get(PR_WAITOK)"); + if (flags & PR_WAITOK) { + ASSERT_SLEEPABLE(); + } #endif cc = pool_cache_cpu_enter(pc, &s); @@ -3063,7 +3062,7 @@ found: snprintf(cpucachestr, sizeof(cpucachestr), "cached by CPU %u", - (u_int)ci->ci_cpuid); + ci->ci_index); goto print; } }