[patch 27/34] s390: Use generic idle loop

Thomas Gleixner
2013-03-21T21:55:52Z

[-- Attachment #1: s390-use-generic-idle-loop.patch --]
[-- Type: text/plain, Size: 1956 bytes --]

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
---
arch/s390/kernel/process.c | 25 +++++++------------------
arch/s390/kernel/smp.c | 3 +--
2 files changed, 8 insertions(+), 20 deletions(-)

Index: linux-2.6/arch/s390/kernel/process.c
===================================================================
--- linux-2.6.orig/arch/s390/kernel/process.c
+++ linux-2.6/arch/s390/kernel/process.c
@@ -62,17 +62,15 @@ unsigned long thread_saved_pc(struct tas
}

/*
- * The idle loop on a S390...
+ * The idle function on a S390...
*/
-static void default_idle(void)
+void arch_cpu_idle(void)
{
- if (cpu_is_offline(smp_processor_id()))
- cpu_die();
- local_irq_disable();
- if (need_resched()) {
+ if (test_thread_flag(TIF_MCCK_PENDING)) {
local_irq_enable();
return;
}
+
local_mcck_disable();
if (test_thread_flag(TIF_MCCK_PENDING)) {
local_mcck_enable();
@@ -83,19 +81,10 @@ static void default_idle(void)
vtime_stop_cpu();
}

-void cpu_idle(void)
+void arch_cpu_idle_exit(void)
{
- for (;;) {
- tick_nohz_idle_enter();
- rcu_idle_enter();
- while (!need_resched() && !test_thread_flag(TIF_MCCK_PENDING))
- default_idle();
- rcu_idle_exit();
- tick_nohz_idle_exit();
- if (test_thread_flag(TIF_MCCK_PENDING))
- s390_handle_mcck();
- schedule_preempt_disabled();
- }
+ if (test_thread_flag(TIF_MCCK_PENDING))
+ s390_handle_mcck();
}

extern void __kprobes kernel_thread_starter(void);
Index: linux-2.6/arch/s390/kernel/smp.c
===================================================================
--- linux-2.6.orig/arch/s390/kernel/smp.c
+++ linux-2.6/arch/s390/kernel/smp.c
@@ -711,8 +711,7 @@ static void __cpuinit smp_start_secondar
set_cpu_online(smp_processor_id(), true);
inc_irq_stat(CPU_RST);
local_irq_enable();
- /* cpu_idle will call schedule for us */
- cpu_idle();
+ cpu_startup_entry(CPUHP_ONLINE);
}

/* Upping and downing of CPUs */