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

Andrea Arcangeli
2004-07-13T22:02:02Z

On Tue, Jul 13, 2004 at 02:54:24PM -0700, Andrew Morton wrote:
> Confused. Where do we call cond_resched() with local interrupts disabled?

there are a lot of cond_resched, we might be calling it with irq
disabled, nobody ever did a might_sleep in the fast path of
cond_resched. And even if nobody does, if entry.S and sched_yield can
optimize, then everybody else can optimize too. It's not like that
entry.S is a piece of scheduler internal that will be obviously modified
if we modify the scheduler. so if you intend to leave those two there's
no point to forbid others to optimize, and there's no might_sleep in
current cond_resched anyways so you're already allowing people to
optimize and I want to allow it still after I add might_sleep there.

> Sleeping with local interrupts disabled is usually a bug, so we should
> prefer to keep that check in might_sleep().

either it's _always_ a bug including for entry.S or sched_yield, or it's
_never_ a bug. I don't understand the "usually".