[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Kernel preemption
On Mon, Apr 28, 2008 at 02:34:35PM -0700, Jason Thorpe wrote:
>>> Yes, I think so. There are long/slow code paths within the kernel.
>> Right, but is it better to handle these by preemption or by setting up
>> to yield the processor before/while locking?
> I think it's better for the scheduler to handle this for us, rather than
> having to identify each of those and figure out where the right places to
> yield are.
Quite possibly, although what I was thinking of was just to have every
(sleeping-ok) lock attempt check to see if the scheduler had tagged
the current process to be preempted and then yield. The advantage of
that is that it creates no new race conditions; the disadvantage of
course is that it adds overhead.
But I'd been thinking about this in terms of my own environment (not
NetBSD) that explicitly distinguishes sleeping locks and spinlocks.
David A. Holland
Main Index |
Thread Index |