Subject: Re: CVS commit: src/sys/kern
To: Andrew Doran <ad@netbsd.org>
From: Jason Thorpe <thorpej@shagadelic.org>
List: source-changes
Date: 03/12/2007 21:24:21
On Mar 12, 2007, at 9:06 PM, Andrew Doran wrote:

>
>>
>>> To elaborate, it can't sleep since it's taken from cpu_switch(),  
>>> so it
> needs to be a spin lock. From kern_ras.c it needs to be taken with the
> kernel_lock held, and in cpu_switch() it is taken without the  
> kernel_lock
> held. So we need to block any interrupts that could take the  
> kernel_lock
> otherwise there is the potential for deadlock. I have the beginnings  
> of a
> lock-free version of ras_lookup() somewhere but have not had the  
> time to
> finish it or test it further.

Sounds like a good argument for putting it in userret() :-)  It's safe  
to sleep there.

-- thorpej