Subject: Re: SMP re-entrancy in kernel drivers/"bottom half?"
To: Jonathan Stone <>
From: Jason Thorpe <>
List: tech-kern
Date: 12/17/2003 19:40:55
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed

On Dec 17, 2003, at 7:31 PM, Jonathan Stone wrote:

> In the long term, no of course not.  I dont have the energy or time
> right now to drop a spinlock into every pcb, *and* get the hash-table
> references right too. But thats clearly the next logical step.
> The reason I sugested for IPL_*_slock is: it means one smp-safe
> interrupt routine at each IPL level can reach outward simultaneously,
> instead of totally serialising all SMP-safe interrupt routines anytime
> they start reaching outside the softc: one NIC interrupt routine *and*
> one disk interrupt routine can touch non-softc stuff simultaneously,
> instead of in serial.

But you can't just do the simple thing (which is to make all calls to 
splnet() both block interrupts *AND* acquire the IPL_NET_slock)...

...because there are some code paths that might splnet() again even if 
we're already at splnet() (because perhaps they call a function that 
can be called in the top-half or the bottom-half, and that function 
needs some protection in it somewhere).

The simple fact of the matter is that it is unavoidable to do the 
careful, correct thing (incrementally, of course).

         -- Jason R. Thorpe <>

content-type: application/pgp-signature; x-mac-type=70674453;
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

Version: GnuPG v1.2.3 (Darwin)