Subject: Re: SMP API things, lock debugging, etc.
To: Stefan Grefen <Stefan.Grefen@tantau.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-smp
Date: 07/27/1999 15:00:47
On Tue, 27 Jul 1999 23:27:08 +0200
Stefan Grefen <Stefan.Grefen@tantau.com> wrote:
> OK lets define the (S)MP semantics of spl*().
Okay! :-)
> Do we block the interrupts on the affected processor or on all processors?
It blocks the specified interrupts on the "current processor", not all.
> Only if it blocks interrupts on all processors this method prevents
> deadlocks.
How so?
CPU 0: s = splfoo(), simple_lock(foo_lock)
CPU 1: foointr (implicit splfoo), simple_lock(foo_lock) ... spins
CPU 0: finishes with foo, simple_unlock(foo_lock), splx(s)
CPU 1: acquires foo_lock, does its thing, simple_unlock(foo_lock)
Can you describe to me a situation where failing to block interrupts on
all processors will cause deadlock (cases where one wasn't careful in
designing the locking protocol for the given subsystem don't count :-)
-- Jason R. Thorpe <thorpej@nas.nasa.gov>