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

On Dec 17, 2003, at 5:52 PM, Jonathan Stone wrote:

> Here is a true fact: we could replace the current spl()s with a
> hierarchy of spinlocks.  In this scheme, instead of raising SPl by
> manipulating mask of `observable' SPLs, raising SPL would be achieved
> by acquiring all the new spl-locks in order (to avoid deadlock).

The hierarchy of simplelocks is simply not an acceptable solution:

	1. spls are not in a strict hierarchy, and so you'd be adding a
	   restriction that is not present on single processor systems.

	2. It would actually make the problem worse than the current
	   situation, where we can currently run some subsystems without
	   acquiring the kernel_lock in carefully-controller circumstances
	   (pk has recently done work on this with vfs_bio, for example).

	3. I'm not seeing how it would actually solve your problem.  If you
	   want to have 2 CPUs handling NIC interrupts, they would both have
	   to acquire the IPL_NET_slock, which would stall one of them.  If
	   you wanted one processing NIC interrupts and one processing soft
	   interrupts, then in your hierarchical scheme, one CPU would hold
	   IPL_SOFTNET_slock and IPL_NET_slock, and another would be trying
	   to acquire IPL_SOFTNET_slock, which would stall.

	4. Having to acquire several simplelocks in a hierarchy would increase
	   the interrupt latency.

What have I missed?

         -- 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)