[patch-mm 01/23] NOHZ: Fix ARM,SH,SPARC64 idle nohz handling
From: Thomas Gleixner
Date: Sun Jun 10 2007 - 05:32:01 EST
The cpuidle patches moved the tick nohz handling from irq_exit into
the inner idle loop. The change is correct as it covers non interrupt
based wakeups (e.g DMA) as well, but the move was only done for i386
and breaks ARM,SH and SPARC64.
Fix it up.
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Adam Belay <abelay@xxxxxxxxxx>
Cc: Len Brown <lenb@xxxxxxxxxx>
Cc: Dave Miller <davem@xxxxxxxxxxxxx>
Cc: Paul Mundt <lethal@xxxxxxxxxxxx>
Cc: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
---
arch/arm/kernel/process.c | 2 +-
arch/sh/kernel/process.c | 5 +++--
arch/sparc64/kernel/process.c | 5 +++--
3 files changed, 7 insertions(+), 5 deletions(-)
Index: linux-2.6.22-rc4-mm/arch/arm/kernel/process.c
===================================================================
--- linux-2.6.22-rc4-mm.orig/arch/arm/kernel/process.c 2007-06-10 10:44:38.000000000 +0200
+++ linux-2.6.22-rc4-mm/arch/arm/kernel/process.c 2007-06-10 10:44:38.000000000 +0200
@@ -130,6 +130,7 @@ static void default_idle(void)
else {
local_irq_disable();
if (!need_resched()) {
+ tick_nohz_stop_sched_tick();
timer_dyn_reprogram();
arch_idle();
}
@@ -160,7 +161,6 @@ void cpu_idle(void)
if (!idle)
idle = default_idle;
leds_event(led_idle_start);
- tick_nohz_stop_sched_tick();
while (!need_resched())
idle();
leds_event(led_idle_end);
Index: linux-2.6.22-rc4-mm/arch/sh/kernel/process.c
===================================================================
--- linux-2.6.22-rc4-mm.orig/arch/sh/kernel/process.c 2007-06-10 10:44:38.000000000 +0200
+++ linux-2.6.22-rc4-mm/arch/sh/kernel/process.c 2007-06-10 10:44:38.000000000 +0200
@@ -62,8 +62,10 @@ void default_idle(void)
clear_thread_flag(TIF_POLLING_NRFLAG);
smp_mb__after_clear_bit();
set_bl_bit();
- while (!need_resched())
+ while (!need_resched()) {
+ tick_nohz_stop_sched_tick();
cpu_sleep();
+ }
clear_bl_bit();
set_thread_flag(TIF_POLLING_NRFLAG);
} else
@@ -82,7 +84,6 @@ void cpu_idle(void)
if (!idle)
idle = default_idle;
- tick_nohz_stop_sched_tick();
while (!need_resched())
idle();
tick_nohz_restart_sched_tick();
Index: linux-2.6.22-rc4-mm/arch/sparc64/kernel/process.c
===================================================================
--- linux-2.6.22-rc4-mm.orig/arch/sparc64/kernel/process.c 2007-06-10 10:44:38.000000000 +0200
+++ linux-2.6.22-rc4-mm/arch/sparc64/kernel/process.c 2007-06-10 10:44:38.000000000 +0200
@@ -89,9 +89,10 @@ void cpu_idle(void)
set_thread_flag(TIF_POLLING_NRFLAG);
while(1) {
- tick_nohz_stop_sched_tick();
- while (!need_resched())
+ while (!need_resched()) {
+ tick_nohz_stop_sched_tick();
sparc64_yield();
+ }
tick_nohz_restart_sched_tick();
preempt_enable_no_resched();
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/