version 1.131.2.4, 2008/03/23 02:05:00 |
version 1.133.4.4, 2008/02/18 21:06:47 |
|
|
/* subr_pool.c,v 1.131.2.3 2008/01/09 01:56:18 matt Exp */ |
/* $NetBSD$ */ |
|
|
/*- |
/*- |
* Copyright (c) 1997, 1999, 2000, 2002, 2007 The NetBSD Foundation, Inc. |
* Copyright (c) 1997, 1999, 2000, 2002, 2007 The NetBSD Foundation, Inc. |
|
|
*/ |
*/ |
|
|
#include <sys/cdefs.h> |
#include <sys/cdefs.h> |
__KERNEL_RCSID(0, "subr_pool.c,v 1.131.2.3 2008/01/09 01:56:18 matt Exp"); |
__KERNEL_RCSID(0, "$NetBSD$"); |
|
|
#include "opt_ddb.h" |
#include "opt_ddb.h" |
#include "opt_pool.h" |
#include "opt_pool.h" |
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(); |
ASSERT_SLEEPABLE(NULL, "pool_get(PR_WAITOK)"); |
} |
|
#endif |
#endif |
|
|
mutex_enter(&pp->pr_lock); |
mutex_enter(&pp->pr_lock); |
Line 1289 pool_do_put(struct pool *pp, void *v, st |
|
Line 1288 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 2522 pool_cache_get_paddr(pool_cache_t pc, in |
|
Line 2522 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(); |
ASSERT_SLEEPABLE(NULL, "pool_cache_get(PR_WAITOK)"); |
} |
|
#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", |
ci->ci_index); |
(u_int)ci->ci_cpuid); |
goto print; |
goto print; |
} |
} |
} |
} |