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 itneeds to be a spin lock. From kern_ras.c it needs to be taken with thekernel_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 tofinish it or test it further.
Sounds like a good argument for putting it in userret() :-) It's safe to sleep there.
-- thorpej