Current-Users archive

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

Re: Kernel panic in "subr_xcall.c"



Manuel Bouyer wrote:
On Mon, Oct 19, 2009 at 05:29:37PM +0200, Jean-Yves Migeon wrote:
The KASSERT() can only fire when ncpu > 1 and there is no CPU flagged with
SPCF_RUNNING.

I think that such a situation is rare during boot; the boot processor
should already have its SPCF_RUNNING flag set before attaching secondary
CPUs.

From memory, I think SPCF_RUNNING is set after all CPUs have been attached
even for the boot CPU.

Correct, the CPUs are attached before configure2() is called, so ncpu is incremented before the schedstate flag is set. Any call inbetween may result in a call to pmap_growkernel().

@tron: could you try with the attached patch please? Thanks!

--
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost
Index: kern/subr_pool.c
===================================================================
RCS file: /cvsroot/src/sys/kern/subr_pool.c,v
retrieving revision 1.176
diff -u -u -r1.176 subr_pool.c
--- kern/subr_pool.c    15 Oct 2009 20:50:12 -0000      1.176
+++ kern/subr_pool.c    19 Oct 2009 21:14:55 -0000
@@ -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