lkml.org 
[lkml]   [2007]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch-mm 01/23] NOHZ: Fix ARM,SH,SPARC64 idle nohz handling
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@linutronix.de>
Cc: Adam Belay <abelay@novell.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Dave Miller <davem@davemloft.net>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>

---
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@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: 2007-06-10 11:35    [W:0.197 / U:60.096 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site