lkml.org 
[lkml]   [2004]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.31-19

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

> ok, this could be ACPI CPU-sleep related. Could you disable all ACPI
> options in your .config (as a workaround), and re-check whether the
> xruns still occur?

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.

Ingo

Signed-off-by: Ingo Molnar <mingo@elte.hu>

--- linux/drivers/acpi/processor.c.orig
+++ linux/drivers/acpi/processor.c
@@ -370,6 +370,15 @@ acpi_processor_idle (void)
*/
local_irq_disable();

+ /*
+ * Check whether we truly need to go idle, or should
+ * reschedule:
+ */
+ if (unlikely(need_resched())) {
+ local_irq_enable();
+ return;
+ }
+
cx = &(pr->power.states[pr->power.state]);

/*
-
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:08    [W:0.172 / U:0.496 seconds]
©2003-2014 Jasper Spaans. Advertise on this site