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.197 retrieving revision 1.198 diff -u -p -r1.197 -r1.198 --- src/sys/kern/subr_pool.c 2012/06/05 22:51:47 1.197 +++ src/sys/kern/subr_pool.c 2012/08/28 15:52:19 1.198 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pool.c,v 1.197 2012/06/05 22:51:47 jym Exp $ */ +/* $NetBSD: subr_pool.c,v 1.198 2012/08/28 15:52:19 christos Exp $ */ /*- * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010 @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.197 2012/06/05 22:51:47 jym Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.198 2012/08/28 15:52:19 christos Exp $"); #include "opt_ddb.h" #include "opt_lockdebug.h" @@ -462,6 +462,8 @@ pool_init(struct pool *pp, size_t size, int off, slack; #ifdef DEBUG + if (__predict_true(!cold)) + mutex_enter(&pool_head_lock); /* * Check that the pool hasn't already been initialised and * added to the list of all pools. @@ -471,6 +473,8 @@ pool_init(struct pool *pp, size_t size, panic("pool_init: pool %s already initialised", wchan); } + if (__predict_true(!cold)) + mutex_exit(&pool_head_lock); #endif if (palloc == NULL)