[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: [linux-audio-dev] Re: [announce] [patch] Voluntary Kernel
From:       Andrew Morton <akpm () osdl ! org>
Date:       2004-07-13 22:25:32
Message-ID: 20040713152532.6df4a163.akpm () osdl ! org
[Download RAW message or body]

Andrea Arcangeli <andrea@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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic