From da7f51c11d5fedca9ba779ee220063ccb4f0a27e Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 5 Jan 2011 12:48:09 +0100 Subject: [S390] smp/idle: call init_idle() before starting a new cpu Call init_idle() which (re-)initializes the idle task structure before it gets used on a new cpu. That way we can also get rid of the odd preempt_enable_no_resched() call we have in the cpu offline path within cpu_idle(). That call prevented preempt count imbalances between cpu hotplug operations. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/include/asm/smp.h | 3 ++- arch/s390/kernel/process.c | 8 ++------ arch/s390/kernel/smp.c | 1 + 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'arch/s390') diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h index edc03cb..045e009f 100644 --- a/arch/s390/include/asm/smp.h +++ b/arch/s390/include/asm/smp.h @@ -20,7 +20,6 @@ extern void machine_power_off_smp(void); extern int __cpu_disable (void); extern void __cpu_die (unsigned int cpu); -extern void cpu_die (void) __attribute__ ((noreturn)); extern int __cpu_up (unsigned int cpu); extern struct mutex smp_cpu_state_mutex; @@ -71,8 +70,10 @@ static inline void smp_switch_to_ipl_cpu(void (*func)(void *), void *data) #ifdef CONFIG_HOTPLUG_CPU extern int smp_rescan_cpus(void); +extern void __noreturn cpu_die(void); #else static inline int smp_rescan_cpus(void) { return 0; } +static inline void cpu_die(void) { } #endif #endif /* __ASM_SMP_H */ diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index b825b3e..c2fffb5 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "entry.h" asmlinkage void ret_from_fork(void) asm ("ret_from_fork"); @@ -76,13 +77,8 @@ unsigned long thread_saved_pc(struct task_struct *tsk) */ static void default_idle(void) { - /* CPU is going idle. */ -#ifdef CONFIG_HOTPLUG_CPU - if (cpu_is_offline(smp_processor_id())) { - preempt_enable_no_resched(); + if (cpu_is_offline(smp_processor_id())) cpu_die(); - } -#endif local_irq_disable(); if (need_resched()) { local_irq_enable(); diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 8e84b5a..10766be 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -575,6 +575,7 @@ int __cpuinit __cpu_up(unsigned int cpu) idle = c_idle.idle; current_set[cpu] = c_idle.idle; } + init_idle(idle, cpu); if (smp_alloc_lowcore(cpu)) return -ENOMEM; do { -- cgit v1.1