Subject: Re: SMP API things, lock debugging, etc.
To: Stefan Grefen <>
From: Jason Thorpe <>
List: tech-smp
Date: 07/28/1999 11:50:03
On Wed, 28 Jul 1999 10:38:20 +0200 
 Stefan Grefen <> wrote:

 > splbar<splfoo
 >        CPU 0: s=splhigh(), simple_lock(foo_lock); simple_lock(bar_lock)
 >        CPU 1: s=splbar(), simple_lock(bar_lock); foointr (implicit splfoo), simple_lock(foo_lock) ... spins

This may be completely legal in the old BSD kernel, but isn't legal in
an SMP kernel.

The goal is to make NetBSD an SMP kernel.  This requires careful locking

 > My strategy for NetBSD SMP would be, simple-locks with global splxxx() to get
 > a SMP system up and running, and than think about doing locks the right way.
 > What the right way is depends on the system you design for (shared memory SMP,
 > NUMA, .... non-shared memory  cluster).

More like, Big Lock is what gets us up and running, and then we carefully
do locking and test that by disabling the Big Lock.

 > BTW.
 > As locks on some systems need to be cache-line sized (HP) we may want to group 
 > those locks (or put them in a hashtable).

I have already addressed this.

        -- Jason R. Thorpe <>