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

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Re: [announce] [patch] Voluntary Kernel Preemption Patch
From: Andrew Morton (akpm_AT_osdl.org)
Date: Wed Jul 14 2004 - 01:25:32 EEST


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.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Jul 14 2004 - 20:55:42 EEST