LKML Archive on
help / color / mirror / Atom feed
From: Ingo Molnar <>
To: Linux Kernel List <>
Subject: Re: scheduler: IRQs disabled over context switches
Date: Mon, 24 May 2004 10:37:15 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

* Russell King <> wrote:

> The 2.6.6 scheduler disables IRQs across context switches, which is
> bad news for IRQ latency on ARM - to the point where 16550A FIFO UARTs
> to overrun.
> I'm considering defining prepare_arch_switch & co as follows on ARM,
> so that we release IRQs over the call to context_switch().

> The question is... why are we keeping IRQs disabled over
> context_switch() in the first case?  Looking at the code, the only
> thing which is touched outside of the two tasks is rq->prev_mm.  Since
> runqueues are CPU- specific and we're holding at least one spinlock, I
> think the above is preempt safe and SMP safe.

historically x86 context-switching has been pretty fragile when done
with irqs enabled. (x86 has tons of legacy baggage, segments, etc.) It's
also slightly faster to do the context-switch in one atomic swoop. On
x86 we do this portion in like 1 usec so it's not a latency issue.

if on ARM context-switching latency gives you UART problems then you can
enables irqs via ARM-specific version of prepare_arch_switch() &


  parent reply	other threads:[~2004-05-24  6:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-23 16:43 Russell King
2004-05-23 18:59 ` Davide Libenzi
2004-05-23 19:38   ` Russell King
2004-05-23 23:04     ` Davide Libenzi
2004-05-23 23:33       ` Russell King
2004-05-24  0:27         ` Davide Libenzi
2004-05-24  8:37 ` Ingo Molnar [this message]
2004-05-24  6:41   ` Davide Libenzi
2004-05-24  9:05     ` Ingo Molnar
2004-05-24  7:10       ` Nick Piggin
2004-05-24  9:15         ` Ingo Molnar
2004-05-24 17:16       ` Davide Libenzi
2004-05-24 17:46         ` Davide Libenzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: scheduler: IRQs disabled over context switches' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).