public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Rui Nuno Capela <rncbc@rncbc.org>
Cc: linux-kernel@vger.kernel.org, Lee Revell <rlrevell@joe-job.com>,
	mark_h_johnson@raytheon.com, "K.R. Foley" <kr@cybsft.com>,
	Bill Huey <bhuey@lnxw.com>, Adam Heath <doogie@debian.org>,
	Florian Schmidt <mista.tapas@gmx.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Michal Schmidt <xschmi00@stud.feec.vutbr.cz>,
	Fernando Pablo Lopez-Lezcano <nando@ccrma.stanford.edu>,
	Karsten Wiese <annabellesgarden@yahoo.de>,
	Gunther Persoons <gunther_persoons@spymac.com>,
	emann@mrv.com, Shane Shrybman <shrybman@aei.ca>,
	Amit Shah <amit.shah@codito.com>,
	Esben Nielsen <simlo@phys.au.dk>, Andrew Morton <akpm@osdl.org>
Subject: Re: [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.31-19
Date: Wed, 1 Dec 2004 17:31:03 +0100	[thread overview]
Message-ID: <20041201163103.GA13922@elte.hu> (raw)
In-Reply-To: <20041201162034.GA8098@elte.hu>

[-- Attachment #1: Type: text/plain, Size: 1925 bytes --]


* Ingo Molnar <mingo@elte.hu> wrote:

> i think i found the bug - it's an upstream ACPI bug. Does the patch
> below (or the -31-19 kernel, which i've just uploaded) fix the xruns?
>
> the upstream ACPI bug is this: we check need_resched() _before_
> disabling preemption. This opens up the following scenario:
> 
>  swapper:	!need_resched()
>  [IRQ context]
> 		wakes up a task
> 		marks idle task as need-resched
> 
>  swapper:	acpi_processor_idle(); // sleeps until next irq
> 
> instant 1msec latency introduced...
>
> normally default_idle() is safe because it re-checks need_resched with
> interrupts disabled before it truly halts the CPU. But
> acpi_processor_idle() doesnt seem to be doing this! Your trace clearly
> shows a missed preemption due to ACPI. I'm wondering why no-one has
> triggered this before, it's a really bad bug that should be fixed in
> 2.6.10.

i've attached the particular trace from Rui's collection of traces which
nicely shows the ACPI race in action. Here are the relevant events:

 swapper-0     08000000 0.840ms (+0.000ms): preempt_schedule (cpu_idle)
 swapper-0     ........ 0.913ms (+0.000ms): ->    IRQ 5-3052 [ 0000001d 0000008c ]: wake_up_process
 swapper-0     08000001 0.913ms (+0.920ms): acpi_processor_idle (cpu_idle)
 swapper-0     ........ 1.834ms (+0.000ms): common_interrupt:  [ e0022266 00000000 00000000 ]
 swapper-0     88010001 1.834ms (+0.000ms): direct_timer_interrupt (do_IRQ)
   IRQ 5-3052  80000002 1.848ms (+0.000ms): __switch_to (__sched_text_start)

i.e. at timestamp 0.840ms cpu_idle() got preempted (it was after the
need_resched() check but before the rcu_read_lock() which disables
preemption), then at 0.913ms a task was woken up by the hardirq context,
but despite this we called into acpi_processor_idle() which slept
dutifully until the next timer interrupt hit us. Then did only the woken
up task schedule. (which caused an xrun in Rui's setup.)

	Ingo

[-- Attachment #2: xruntrace1-2.6.10-rc2-mm3-RT-V0.7.31-15-20041201143614.trc.gz --]
[-- Type: application/x-gzip, Size: 30870 bytes --]

  reply	other threads:[~2004-12-01 16:31 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-26 12:12 Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.31-7 Rui Nuno Capela
2004-11-29 11:05 ` Ingo Molnar
2004-11-29 11:16 ` Ingo Molnar
2004-11-29 11:24   ` Ingo Molnar
2004-11-29 15:42     ` Ingo Molnar
2004-11-29 13:13   ` Rui Nuno Capela
2004-11-29 14:33     ` Ingo Molnar
2004-11-29 15:23       ` Ingo Molnar
2004-11-29 23:16         ` Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.31-13 Gene Heskett
2004-11-30  1:50           ` K.R. Foley
2004-11-30  3:19             ` Gene Heskett
2004-11-30  4:54             ` Gene Heskett
2004-11-30 15:26               ` K.R. Foley
2004-11-30 16:24                 ` Gene Heskett
2004-11-30 16:52                   ` Zwane Mwaikambo
2004-12-01  7:16                     ` Gene Heskett
2004-11-30 16:57                   ` K.R. Foley
2004-11-30 10:29         ` Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.31-7 Rui Nuno Capela
2004-11-30 13:19           ` Ingo Molnar
2004-11-30 15:39             ` Rui Nuno Capela
2004-11-30 16:42               ` Ingo Molnar
2004-12-01 10:32               ` Ingo Molnar
2004-12-01 11:25                 ` Ingo Molnar
2004-12-01 12:49                   ` Rui Nuno Capela
2004-12-01 12:47                 ` Rui Nuno Capela
2004-12-01 15:40                   ` Ingo Molnar
2004-12-01 16:06                     ` Ingo Molnar
2004-12-01 16:20                       ` [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.31-19 Ingo Molnar
2004-12-01 16:31                         ` Ingo Molnar [this message]
2004-12-01 18:59                         ` Rui Nuno Capela
2004-12-01 21:29                           ` Ingo Molnar
2004-12-01 21:30                             ` Ingo Molnar
     [not found]                               ` <32788.192.168.1.8.1101938057.squirrel@192.168.1.8>
2004-12-01 21:58                                 ` Ingo Molnar
2004-12-01 22:04                                   ` Rui Nuno Capela
2004-12-01 22:09                                 ` Ingo Molnar
2004-12-01 22:31                                   ` Rui Nuno Capela
2004-12-02  9:12                                     ` Rui Nuno Capela
2004-12-02 12:59                                       ` Rui Nuno Capela
2004-12-02 16:38                                         ` Fernando Lopez-Lezcano
2004-12-01 22:43                                   ` Florian Schmidt
2004-12-02  8:40                                     ` Ingo Molnar
2004-12-02 12:22                                       ` Florian Schmidt
2004-12-02 12:29                                         ` Ingo Molnar
2004-12-02 13:06                                           ` Florian Schmidt
2004-12-02 13:10                                             ` Ingo Molnar
2004-12-02 13:40                                               ` Florian Schmidt
2004-12-02 13:49                                                 ` Ingo Molnar
2004-12-02 16:08                                                   ` Florian Schmidt
2004-12-02 17:44                                                   ` Florian Schmidt
2004-12-02 21:12                                                     ` Florian Schmidt
2004-12-02 13:18                                             ` Rui Nuno Capela
2004-12-03  1:41                         ` Fernando Lopez-Lezcano
2004-12-03  2:23                           ` Fernando Lopez-Lezcano
2004-11-30 18:13   ` Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.31-7 Remi Colinet
2004-11-30  8:15     ` Ingo Molnar
2004-12-01  8:30       ` Eran Mann
2004-12-01  8:53         ` Ingo Molnar
2004-12-01 18:19           ` Adam Heath
  -- strict thread matches above, loose matches on Subject: below --
2004-12-02 21:01 [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.31-19 Mark_H_Johnson

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20041201163103.GA13922@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=amit.shah@codito.com \
    --cc=annabellesgarden@yahoo.de \
    --cc=bhuey@lnxw.com \
    --cc=doogie@debian.org \
    --cc=emann@mrv.com \
    --cc=gunther_persoons@spymac.com \
    --cc=kr@cybsft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark_h_johnson@raytheon.com \
    --cc=mista.tapas@gmx.net \
    --cc=nando@ccrma.stanford.edu \
    --cc=rlrevell@joe-job.com \
    --cc=rncbc@rncbc.org \
    --cc=shrybman@aei.ca \
    --cc=simlo@phys.au.dk \
    --cc=tglx@linutronix.de \
    --cc=xschmi00@stud.feec.vutbr.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox