Module Name:    src
Committed By:   mlelstv
Date:           Sun Jan  3 01:07:19 UTC 2010

Modified Files:
        src/sys/kern: subr_pool.c

Log Message:
Pools are created way before the pool subsystem mutexes are
initialized.

Ignore also pool_allocator_lock while the system is in cold state.

When the system has left cold state, uvm_init() should have
also initialized the pool subsystem and the mutexes are
ready to use.


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/kern/subr_pool.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/subr_pool.c
diff -u src/sys/kern/subr_pool.c:1.179 src/sys/kern/subr_pool.c:1.180
--- src/sys/kern/subr_pool.c:1.179	Sat Jan  2 15:20:39 2010
+++ src/sys/kern/subr_pool.c	Sun Jan  3 01:07:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pool.c,v 1.179 2010/01/02 15:20:39 mlelstv Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.180 2010/01/03 01:07:19 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.179 2010/01/02 15:20:39 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.180 2010/01/03 01:07:19 mlelstv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pool.h"
@@ -666,7 +666,8 @@
 			palloc = &pool_allocator_nointr_fullpage;
 	}		
 #endif /* POOL_SUBPAGE */
-	mutex_enter(&pool_allocator_lock);
+	if (!cold)
+		mutex_enter(&pool_allocator_lock);
 	if (palloc->pa_refcnt++ == 0) {
 		if (palloc->pa_pagesz == 0)
 			palloc->pa_pagesz = PAGE_SIZE;
@@ -681,7 +682,8 @@
 			pa_reclaim_register(palloc);
 		}
 	}
-	mutex_exit(&pool_allocator_lock);
+	if (!cold)
+		mutex_exit(&pool_allocator_lock);
 
 	if (align == 0)
 		align = ALIGN(1);

Reply via email to