Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Nov 1996 20:50:46 -0700
From:      Steve Passe <smp@csn.net>
To:        freebsd-smp@freefall.freebsd.org
Cc:        "John S. Dyson" <toor@dyson.iquest.net>
Subject:   Re: SMP -current merge 
Message-ID:  <199611230350.UAA13108@clem.systemsix.com>

index | next in thread | raw e-mail

Hi,

Additional clues on SMP brokeness.

I added this patch to kern/init_main.c:smp_idle():

----------------------------------- cut --------------------------------------
*** init_main.c 1996/11/22 18:04:29     1.1
--- init_main.c 1996/11/22 20:30:00
***************
*** 812,817 ****
--- 812,835 ----
                        rel_mplock();
                }
                        
+ #if 1
+               if (smp_active == 2 && cpunumber() != 0) {
+                       get_mplock();
+                       printf("cpu#%d spinning; mp_lock: %08x\n", cpunumber(),
+                               mp_lock);
+                       wakeup((caddr_t)&smp_active);
+                       rel_mplock();
+ 
+                       while (smp_active == 2) {
+                               __asm __volatile("" : : : "memory");
+                       }
+                       get_mplock();
+                       printf("cpu#%d waking up! mp_lock: %08x\n", 
cpunumber(),
+                               mp_lock);
+                       rel_mplock();
+               }
+ #endif /** 1 */                       
+ 
                if (whichqs || whichrtqs || whichidqs) {
  
                        /* grab lock for kernel "entry" */
----------------------------------- cut --------------------------------------
What it does is "freeze" the 2nd CPU after it has initialized itself and is
about to run its first proc.  When I start it via "sysctl kern.smp_active=2"
it gets to this point without hurting the system.  The first CPU returns
from the sysctl, and I can continue to use the system without reboot.  If I
allow the 2nd CPU to exit this freeze via "sysctl kern.smp_active=3" I
get the prompt back, but, as before, the first action causes a REBOOT.

If I change:
+               if (smp_active == 2 && cpunumber() != 0) {
to:
+               if (smp_active == 2 && cpunumber() == 0) {

it works differently.  This change causes the 1st CPU to be the one frozen,
ie the 2nd CPU is now the only one running.  I cannot do anything else after
the sysctl returns without REBOOTing.  Ie, its NOT that 2 CPUs are running,
its the running of the 2nd CPU that REBOOTs.

So it appears that the 2nd CPU is not getting a correct environment in which
to run anymore.  Could this be something different in the VM system?
It appears to have changed alot since the last merge.

--
Steve Passe	| powered by
smp@csn.net	|            FreeBSD

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAzHe7tEAAAEEAM274wAEEdP+grIrV6UtBt54FB5ufifFRA5ujzflrvlF8aoE
04it5BsUPFi3jJLfvOQeydbegexspPXL6kUejYt2OeptHuroIVW5+y2M2naTwqtX
WVGeBP6s2q/fPPAS+g+sNZCpVBTbuinKa/C4Q6HJ++M9AyzIq5EuvO0a8Rr9AAUR
tBlTdGV2ZSBQYXNzZSA8c21wQGNzbi5uZXQ+
=ds99
-----END PGP PUBLIC KEY BLOCK-----



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611230350.UAA13108>