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.158.2.2 retrieving revision 1.165.2.2 diff -u -p -r1.158.2.2 -r1.165.2.2 --- src/sys/kern/subr_pool.c 2009/05/04 08:13:48 1.158.2.2 +++ src/sys/kern/subr_pool.c 2008/10/19 22:17:28 1.165.2.2 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pool.c,v 1.158.2.2 2009/05/04 08:13:48 yamt Exp $ */ +/* $NetBSD: subr_pool.c,v 1.165.2.2 2008/10/19 22:17:28 haad Exp $ */ /*- * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.158.2.2 2009/05/04 08:13:48 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.165.2.2 2008/10/19 22:17:28 haad Exp $"); #include "opt_ddb.h" #include "opt_pool.h" @@ -2528,23 +2528,8 @@ pool_cache_put_slow(pool_cache_cpu_t *cc KASSERT(cc->cc_previous->pcg_avail == cc->cc_previous->pcg_size); pc = cc->cc_cache; - pcg = NULL; cc->cc_misses++; - /* - * If there are no empty groups in the cache then allocate one - * while still unlocked. - */ - if (__predict_false(pc->pc_emptygroups == NULL)) { - if (__predict_true(!pool_cache_disable)) { - pcg = pool_get(pc->pc_pcgpool, PR_NOWAIT); - } - if (__predict_true(pcg != NULL)) { - pcg->pcg_avail = 0; - pcg->pcg_size = pc->pc_pcgsize; - } - } - /* Lock the cache. */ if (__predict_false(!mutex_tryenter(&pc->pc_lock))) { ncsw = curlwp->l_ncsw; @@ -2557,16 +2542,20 @@ pool_cache_put_slow(pool_cache_cpu_t *cc */ if (__predict_false(curlwp->l_ncsw != ncsw)) { mutex_exit(&pc->pc_lock); - if (pcg != NULL) { - pool_put(pc->pc_pcgpool, pcg); - } return true; } } /* If there are no empty groups in the cache then allocate one. */ - if (pcg == NULL && pc->pc_emptygroups != NULL) { - pcg = pc->pc_emptygroups; + if (__predict_false((pcg = pc->pc_emptygroups) == NULL)) { + if (__predict_true(!pool_cache_disable)) { + pcg = pool_get(pc->pc_pcgpool, PR_NOWAIT); + } + if (__predict_true(pcg != NULL)) { + pcg->pcg_avail = 0; + pcg->pcg_size = pc->pc_pcgsize; + } + } else { pc->pc_emptygroups = pcg->pcg_next; pc->pc_nempty--; } @@ -2621,7 +2610,6 @@ pool_cache_put_paddr(pool_cache_t pc, vo pcg_t *pcg; int s; - KASSERT(object != NULL); FREECHECK_IN(&pc->pc_freecheck, object); /* Lock out interrupts and disable preemption. */