lkml.org 
[lkml]   [2004]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [linux-audio-dev] Re: [announce] [patch] Voluntary Kernel Preemption Patch
Andrea Arcangeli <andrea@suse.de> wrote:
>
> On Mon, Jul 12, 2004 at 05:08:44PM -0700, Andrew Morton wrote:
> > of code then it's pretty obvious what's happening. If the trace is due to
> > a long irq-off time then it will point up into the offending
> > local_irq_enable().
>
> schedule should be called with irq enabled, and I noticed here it's not
> (jnz work_resched is executed with irq off so there is a window for
> schedule to be called with irq off):
>
> Index: linux-2.5/arch/i386/kernel/entry.S
> ===================================================================
> RCS file: /home/andrea/crypto/cvs/linux-2.5/arch/i386/kernel/entry.S,v
> retrieving revision 1.86
> diff -u -p -r1.86 entry.S
> --- linux-2.5/arch/i386/kernel/entry.S 23 May 2004 05:03:15 -0000 1.86
> +++ linux-2.5/arch/i386/kernel/entry.S 13 Jul 2004 04:21:55 -0000
> @@ -302,6 +310,7 @@ work_pending:
> testb $_TIF_NEED_RESCHED, %cl
> jz work_notifysig
> work_resched:
> + sti
> call schedule
> cli # make sure we don't miss an interrupt
> # setting need_resched or sigpending

sys_sched_yield() also calls schedule() with local interrupts disabled.
It's a bit grubby, but saves a few cycles. Nick and Ingo prefer it that way.
-
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/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.230 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site