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 rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/subr_pool.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.184 retrieving revision 1.188 diff -u -p -r1.184 -r1.188 --- src/sys/kern/subr_pool.c 2010/05/12 03:43:46 1.184 +++ src/sys/kern/subr_pool.c 2011/01/17 07:36:58 1.188 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pool.c,v 1.184 2010/05/12 03:43:46 rmind Exp $ */ +/* $NetBSD: subr_pool.c,v 1.188 2011/01/17 07:36:58 uebayasi Exp $ */ /*- * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010 @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.184 2010/05/12 03:43:46 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.188 2011/01/17 07:36:58 uebayasi Exp $"); #include "opt_ddb.h" #include "opt_pool.h" @@ -54,7 +54,10 @@ __KERNEL_RCSID(0, "$NetBSD: subr_pool.c, #include #include -#include +#include +#ifdef DIAGNOSTIC +#include /* uvm_km_va_drain */ +#endif /* * Pool resource management utility. @@ -992,7 +995,8 @@ pool_get(struct pool *pp, int flags) if (pp->pr_itemsperpage == 0) panic("pool_get: pool '%s': pr_itemsperpage is zero, " "pool not initialized?", pp->pr_wchan); - if ((cpu_intr_p() || cpu_softintr_p()) && pp->pr_ipl == IPL_NONE) + if ((cpu_intr_p() || cpu_softintr_p()) && pp->pr_ipl == IPL_NONE && + !cold && panicstr == NULL) panic("pool '%s' is IPL_NONE, but called from " "interrupt context\n", pp->pr_wchan); #endif @@ -1744,12 +1748,13 @@ pool_drain_start(struct pool **ppp, uint } } -void +bool pool_drain_end(struct pool *pp, uint64_t where) { + bool reclaimed; if (pp == NULL) - return; + return false; KASSERT(pp->pr_refcnt > 0); @@ -1758,13 +1763,15 @@ pool_drain_end(struct pool *pp, uint64_t xc_wait(where); /* Drain the cache (if any) and pool.. */ - pool_reclaim(pp); + reclaimed = pool_reclaim(pp); /* Finally, unlock the pool. */ mutex_enter(&pool_head_lock); pp->pr_refcnt--; cv_broadcast(&pool_busy); mutex_exit(&pool_head_lock); + + return reclaimed; } /* @@ -2529,7 +2536,7 @@ pool_cache_get_paddr(pool_cache_t pc, in int s; KASSERTMSG((!cpu_intr_p() && !cpu_softintr_p()) || - (pc->pc_pool.pr_ipl != IPL_NONE || cold), + (pc->pc_pool.pr_ipl != IPL_NONE || cold || panicstr != NULL), ("pool '%s' is IPL_NONE, but called from interrupt context\n", pc->pc_pool.pr_wchan));