Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Fix a bug where on MP systems, pool_cache_invalidat...



details:   https://anonhg.NetBSD.org/src/rev/144c99c8d20d
branches:  trunk
changeset: 748323:144c99c8d20d
user:      jym <jym%NetBSD.org@localhost>
date:      Tue Oct 20 17:24:22 2009 +0000

description:
Fix a bug where on MP systems, pool_cache_invalidate(9) could be called
early during boot, just after CPUs are attached but before they are marked
as running.

This will result in a list of CPUs without the SPCF_RUNNING flag set, and
will trigger the 'KASSERT(xc_tailp < xc_headp)' in xc_lowpri() as no cross
call is issued.

Bug reported and patch tested by tron@.

See also http://mail-index.netbsd.org/tech-kern/2009/10/19/msg006293.html

diffstat:

 sys/kern/subr_pool.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 17440231838d -r 144c99c8d20d sys/kern/subr_pool.c
--- a/sys/kern/subr_pool.c      Tue Oct 20 16:17:07 2009 +0000
+++ b/sys/kern/subr_pool.c      Tue Oct 20 17:24:22 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_pool.c,v 1.176 2009/10/15 20:50:12 thorpej Exp $  */
+/*     $NetBSD: subr_pool.c,v 1.177 2009/10/20 17:24:22 jym 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.176 2009/10/15 20:50:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.177 2009/10/20 17:24:22 jym Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pool.h"
@@ -2300,7 +2300,7 @@
        pcg_t *full, *empty, *part;
        uint64_t where;
 
-       if (ncpu < 2) {
+       if (ncpu < 2 || !mp_online) {
                /*
                 * We might be called early enough in the boot process
                 * for the CPU data structures to not be fully initialized.



Home | Main Index | Thread Index | Old Index