Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/smp: Avoid busy loop after halt and "begin" on z/VM

Currently the smp_stop_cpu() function for SMP kernels enters a busy
loop when "begin" is entered on the z/VM console after Linux is halted.
To avoid this behavior, use the non-SMP variant of smp_stop_cpu()
which stops the CPU again after "begin" is entered. As a side
effect we now have consistent behavior for SMP and non-SMP Linux.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Michael Holzheu and committed by
Martin Schwidefsky
f4192bf2 0d234a28

+2 -12
+2 -3
arch/s390/include/asm/smp.h
··· 30 30 extern int smp_vcpu_scheduled(int cpu); 31 31 extern void smp_yield_cpu(int cpu); 32 32 extern void smp_yield(void); 33 - extern void smp_stop_cpu(void); 34 33 extern void smp_cpu_set_polarization(int cpu, int val); 35 34 extern int smp_cpu_get_polarization(int cpu); 36 35 extern void smp_fill_possible_mask(void); ··· 53 54 static inline void smp_yield(void) { } 54 55 static inline void smp_fill_possible_mask(void) { } 55 56 57 + #endif /* CONFIG_SMP */ 58 + 56 59 static inline void smp_stop_cpu(void) 57 60 { 58 61 u16 pcpu = stap(); ··· 64 63 cpu_relax(); 65 64 } 66 65 } 67 - 68 - #endif /* CONFIG_SMP */ 69 66 70 67 #ifdef CONFIG_HOTPLUG_CPU 71 68 extern int smp_rescan_cpus(void);
-9
arch/s390/kernel/smp.c
··· 405 405 } 406 406 407 407 /* 408 - * Stop the current cpu. 409 - */ 410 - void smp_stop_cpu(void) 411 - { 412 - pcpu_sigp_retry(pcpu_devices + smp_processor_id(), SIGP_STOP, 0); 413 - for (;;) ; 414 - } 415 - 416 - /* 417 408 * This is the main routine where commands issued by other 418 409 * cpus are handled. 419 410 */