Re: [linux-audio-dev] Re: [announce] [patch] Voluntary Kernel Preemption Patch

From: Andrea Arcangeli
Date: Tue Jul 13 2004 - 17:57:11 EST


On Tue, Jul 13, 2004 at 03:44:48PM -0700, Andrew Morton wrote:
> Yeah, I know. might_sleep() in cond_resched() makes sense.

What I'm doing is basically to replace all might_sleep with cond_resched
and then I add might_sleep in cond_resched. I also merged all
new might_sleep in Ingo's patch (converted to cond_resched). We'll see
what happens then when I try to boot such a thing (the sti and
sched_yield already given me some troubles).

I was considering adding a cond_resched_costly but I didn't see anything
really that costly to need a CONFIG_LOW_RESCHED_OVERHEAD.

btw, cond_resched should only be defined as might_sleep with PREEMPT
enabled, otherwise it's pointless to check need_resched at almost every
spin_unlock and to do it during cond_resched too. if might_sleep doesn't
BUG it means we didn't need to check need_resched in the first place if
preempt is enabled.

cond_resched_lock is another story of course.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/