Subject: Re: splx() optimization [was Re: SMP re-eetrancy in "bottom half" drivers]
To: Jason Thorpe <thorpej@shagadelic.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 06/09/2005 08:22:30
On Wed, Jun 08, 2005 at 10:03:10PM -0700, Bill Studenmund wrote:
> 
> What I don't get is that when we're in the kernel, we grab the 
> kernel_lock, and when we're in an interrupt handler, we grab the 
> kernel_lock. How do we keep the two of those from deadlocking?

I suspect a single cpu can acquire the kernel_lock many times...

However this makes me realise there is a bigger problem.
If cpu1 has the kernel_lock, then an interrupt on cpu0 will spin
waiting for the lock - so interrupts are effectively disabled
whenever the kernel is running.
(unless something magic directs interrupts to the cpu holding the lock)

	David

-- 
David Laight: david@l8s.co.uk