Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Aug 1997 11:57:25 +0800
From:      Peter Wemm <peter@spinner.dialix.com.au>
To:        smp@freebsd.org
Subject:   smp changes
Message-ID:  <199708270357.LAA04217@spinner.dialix.com.au>

next in thread | raw e-mail | index | archive | help
I committed some changes a while ago:
====
peter       1997/08/26 11:10:38 PDT

  Modified files:
    sys/conf             files 
    sys/i386/i386        locore.s machdep.c mp_machdep.c mpboot.s 
                         mplock.s pmap.c swtch.s trap.c 
                         vm_machdep.c 
    sys/i386/include     smp.h 
    sys/kern             init_main.c 
  Removed files:
    sys/kern             init_smp.c 
  Log:
  Clean up the SMP AP bootstrap and eliminate the wretched idle procs.
  
  - We now have enough per-cpu idle context, the real idle loop has been
  revived (cpu's halt now with nothing to do).
  - Some preliminary support for running some operations outside the
  global lock (eg: zeroing "free but not yet zeroed pages") is present
  but appears to cause problems.  Off by default.
  - the smp_active sysctl now behaves differently. It's merely a 'true/false'
  option.  Setting smp_active to zero causes the AP's to halt in the idle
  loop and stop scheduling processes.
  - bootstrap is a lot safer.  Instead of sharing a statically compiled in
  stack a number of times (which has caused lots of problems) and then
  abandoning it, we use the idle context to boot the AP's directly.  This
  should help >2 cpu support since the bootlock stuff was in doubt.
  - print physical apic id in traps.. helps identify private pages getting
  out of sync.  (You don't want to know how much hair I tore out with this!)
  
  Modified files:
    sys/kern             kern_shutdown.c 
    sys/i386/i386        mp_machdep.c 
  Log:
  Correct some things I forgot about until it was too late with smp_active.
  smp_active = 1 used to indicate that the system had frozen previously
  started AP's, while smp_active = 0 was "AP's not yet started".  I have split
  this into smp_started (which is set when the AP's come online), and
  smp_active is left for turning on/off AP scheduling.
====

I wouldn't expect this to change the works/not-works status of the kernel
at the moment.  I'd like to know if it breaks the kernel that used to work 
just before the commits for somebody .

I had a lot of nightmares trying to get this working even though the final 
diffs turned out to look depressingly simple. :-]  I was first working on 
this in the beginning of June... :-/

Among the problems to watch out for is one cpu loosing sync with it's 
private pages.  Since we use logical cpuid's stored in the private pages, 
this is pretty nasty - generally once cpu thinks it's the other one (I was 
having problems with cpu#0 suddenly "becoming" cpu#1).  This breaks the 
locking, trashes the stacks and causes general unhappiness.

This commit clears the way for cpu binding and soft affinity (which gets
the best benefit from L1 caches, as well as being virtually essential for
the PPro series with a per-cpu L2 cache and (generally) no shared L3 
cache) and some other nice things.

Cheers,
-Peter





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