aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2015-01-28 01:43:56 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-01-29 03:19:16 -0500
commit4d92f50249eb3ed1c066276e214e8cc7be81e96d (patch)
treed5d772fb65e20be03a5cdb5f323a66308a6d52e8
parentbdea1f1bb273383312f0eca56241794b06ed4205 (diff)
s390: reintroduce diag 44 calls for cpu_relax()
Christian Borntraeger reported that the now missing diag 44 calls (voluntary time slice end) does cause a performance regression for stop_machine() calls if a machine has more virtual cpus than the host has physical cpus. This patch mainly reverts 57f2ffe14fd125c2 ("s390: remove diag 44 calls from cpu_relax()") with the exception that we still do not issue diag 44 calls if running with smt enabled. Due to group scheduling algorithms when running in LPAR this would lead to significant latencies. However, when running in LPAR we do not have more virtual than physical cpus. Reported-and-tested-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/include/asm/processor.h5
-rw-r--r--arch/s390/kernel/processor.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index bed05ea7ec27..e7cbbdcdee13 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -215,10 +215,7 @@ static inline unsigned short stap(void)
215/* 215/*
216 * Give up the time slice of the virtual PU. 216 * Give up the time slice of the virtual PU.
217 */ 217 */
218static inline void cpu_relax(void) 218void cpu_relax(void);
219{
220 barrier();
221}
222 219
223#define cpu_relax_lowlatency() barrier() 220#define cpu_relax_lowlatency() barrier()
224 221
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c
index dbdd33ee0102..26108232fcaa 100644
--- a/arch/s390/kernel/processor.c
+++ b/arch/s390/kernel/processor.c
@@ -8,16 +8,24 @@
8 8
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/smp.h>
12#include <linux/seq_file.h> 11#include <linux/seq_file.h>
13#include <linux/delay.h> 12#include <linux/delay.h>
14#include <linux/cpu.h> 13#include <linux/cpu.h>
15#include <asm/elf.h> 14#include <asm/elf.h>
16#include <asm/lowcore.h> 15#include <asm/lowcore.h>
17#include <asm/param.h> 16#include <asm/param.h>
17#include <asm/smp.h>
18 18
19static DEFINE_PER_CPU(struct cpuid, cpu_id); 19static DEFINE_PER_CPU(struct cpuid, cpu_id);
20 20
21void cpu_relax(void)
22{
23 if (!smp_cpu_mtid && MACHINE_HAS_DIAG44)
24 asm volatile("diag 0,0,0x44");
25 barrier();
26}
27EXPORT_SYMBOL(cpu_relax);
28
21/* 29/*
22 * cpu_init - initializes state that is per-CPU. 30 * cpu_init - initializes state that is per-CPU.
23 */ 31 */