Subject: Re: splx() optimization [was Re: SMP re-eetrancy in "bottom half" drivers]
To: Jonathan Stone <jonathan@dsg.stanford.edu>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 06/07/2005 14:21:57
On Jun 5, 2005, at 11:23 PM, Jonathan Stone wrote:

> The current, non-SMP, biglock semantics for SPLS _are_ implicitly
> global, at least for spl levels where (by assumption) the calling code
> already holds kernel_lock.

No!  There is already some code that runs outside the perimeter of  
kernel_lock.  Certain machine-dependent operations (like IPIs) as  
well as hardclock().  In fact, this is critical in order for our  
current SMP implementation to work at all.

>   Therefore, to faithfully emulate the
> current SPL calls in a kernel where the kernel_lock is not held on
> entry to all interrupt handlers (or other kernel code which raises
> spl), those spl*() calls *must* acquire some global lock.

No, in the current scheme of things, a spl call does not imply  
acquiring a global lock.

Look, we're talking about it all backwards here.  The right semantics  
are to introduce locks around various perimeters that block the  
appropriate interrupts (or none, if that is appropriate).

-- thorpej