Skip to content

Commit 1b68ac8

Browse files
heicarstVasily Gorbik
authored andcommitted
s390: remove last diag 0x44 caller
diag 0x44 is a voluntary undirected yield of a virtual CPU. This has caused a lot of performance issues in the past. There is only one caller left, and that one is only executed if diag 0x9c (directed yield) is not present. Given that all hypervisors implement diag 0x9c anyway, remove the last diag 0x44 to avoid that more callers will be added. Worst case that could happen now, if diag 0x9c is not present, is that a virtual CPU would loop a bit instead of giving its time slice up. diag 0x44 statistics in debugfs are kept and will always be zero, so that user space can tell that there are no calls. Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 157309a commit 1b68ac8

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

arch/s390/include/asm/setup.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#define MACHINE_FLAG_DIAG9C BIT(3)
2828
#define MACHINE_FLAG_ESOP BIT(4)
2929
#define MACHINE_FLAG_IDTE BIT(5)
30-
#define MACHINE_FLAG_DIAG44 BIT(6)
3130
#define MACHINE_FLAG_EDAT1 BIT(7)
3231
#define MACHINE_FLAG_EDAT2 BIT(8)
3332
#define MACHINE_FLAG_TOPOLOGY BIT(10)
@@ -94,7 +93,6 @@ extern unsigned long __swsusp_reset_dma;
9493
#define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
9594
#define MACHINE_HAS_ESOP (S390_lowcore.machine_flags & MACHINE_FLAG_ESOP)
9695
#define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
97-
#define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
9896
#define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
9997
#define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
10098
#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)

arch/s390/kernel/early.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,6 @@ static __init void detect_diag9c(void)
204204
S390_lowcore.machine_flags |= MACHINE_FLAG_DIAG9C;
205205
}
206206

207-
static __init void detect_diag44(void)
208-
{
209-
int rc;
210-
211-
diag_stat_inc(DIAG_STAT_X044);
212-
asm volatile(
213-
" diag 0,0,0x44\n"
214-
"0: la %0,0\n"
215-
"1:\n"
216-
EX_TABLE(0b,1b)
217-
: "=d" (rc) : "0" (-EOPNOTSUPP) : "cc");
218-
if (!rc)
219-
S390_lowcore.machine_flags |= MACHINE_FLAG_DIAG44;
220-
}
221-
222207
static __init void detect_machine_facilities(void)
223208
{
224209
if (test_facility(8)) {
@@ -331,7 +316,6 @@ void __init startup_init(void)
331316
setup_arch_string();
332317
setup_boot_command_line();
333318
detect_diag9c();
334-
detect_diag44();
335319
detect_machine_facilities();
336320
save_vector_registers();
337321
setup_topology();

arch/s390/kernel/smp.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,11 @@ EXPORT_SYMBOL(arch_vcpu_is_preempted);
413413

414414
void smp_yield_cpu(int cpu)
415415
{
416-
if (MACHINE_HAS_DIAG9C) {
417-
diag_stat_inc_norecursion(DIAG_STAT_X09C);
418-
asm volatile("diag %0,0,0x9c"
419-
: : "d" (pcpu_devices[cpu].address));
420-
} else if (MACHINE_HAS_DIAG44 && !smp_cpu_mtid) {
421-
diag_stat_inc_norecursion(DIAG_STAT_X044);
422-
asm volatile("diag 0,0,0x44");
423-
}
416+
if (!MACHINE_HAS_DIAG9C)
417+
return;
418+
diag_stat_inc_norecursion(DIAG_STAT_X09C);
419+
asm volatile("diag %0,0,0x9c"
420+
: : "d" (pcpu_devices[cpu].address));
424421
}
425422

426423
/*

0 commit comments

Comments
 (0)