[linux-audio-dev] Re: [announce] [patch] Voluntary Kernel Preemption Patch
Andrew Morton
akpm at osdl.org
Tue Jul 13 22:25:32 UTC 2004
Andrea Arcangeli <andrea at suse.de> wrote:
>
> > 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".
If some code does:
local_irq_disable();
<fiddle with per-cpu stuff>
kmalloc(GFP_KERNEL);
<fiddle with per-cpu stuff>
local_irq_enable();
or
local_irq_disable();
<fiddle with per-cpu stuff>
function_which_calls_cond_resched();
<fiddle with per-cpu stuff>
local_irq_enable();
then we want might_sleep() to warn about the bug.
The fact that a couple of scheduler-internal fastpaths happen to know that
they can call schedule() with interrupts disabled is not relevant to this.
More information about the Linux-audio-dev
mailing list