Skip to content

Commit 4bb5e07

Browse files
heicarstMartin Schwidefsky
authored andcommitted
[S390] Limit cpu detection to 256 physical cpus.
Saves us more than 65k pointless IPIs. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 53f8c57 commit 4bb5e07

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

‎arch/s390/include/asm/cpu.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_S390_CPU_H
2+
#define _ASM_S390_CPU_H
3+
4+
#define MAX_CPU_ADDRESS 255
5+
6+
#endif /* _ASM_S390_CPU_H */

‎arch/s390/kernel/head.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <asm/asm-offsets.h>
2828
#include <asm/thread_info.h>
2929
#include <asm/page.h>
30+
#include <asm/cpu.h>
3031

3132
#ifdef CONFIG_64BIT
3233
#define ARCH_OFFSET 4

‎arch/s390/kernel/head64.S‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ startup_continue:
6262
clr %r11,%r12
6363
je 5f # no more space in prefix array
6464
4:
65-
ahi %r8,1 # next cpu (r8 += 1)
66-
cl %r8,.Llast_cpu-.LPG1(%r13) # is last possible cpu ?
67-
jl 1b # jump if not last cpu
65+
ahi %r8,1 # next cpu (r8 += 1)
66+
chi %r8,MAX_CPU_ADDRESS # is last possible cpu ?
67+
jle 1b # jump if not last cpu
6868
5:
6969
lhi %r1,2 # mode 2 = esame (dump)
7070
j 6f
@@ -130,8 +130,6 @@ startup_continue:
130130
#ifdef CONFIG_ZFCPDUMP
131131
.Lcurrent_cpu:
132132
.long 0x0
133-
.Llast_cpu:
134-
.long 0x0000ffff
135133
.Lpref_arr_ptr:
136134
.long zfcpdump_prefix_array
137135
#endif /* CONFIG_ZFCPDUMP */

‎arch/s390/kernel/smp.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <asm/sclp.h>
5050
#include <asm/cputime.h>
5151
#include <asm/vdso.h>
52+
#include <asm/cpu.h>
5253
#include "entry.h"
5354

5455
static struct task_struct *current_set[NR_CPUS];
@@ -300,7 +301,7 @@ static int smp_rescan_cpus_sigp(cpumask_t avail)
300301
logical_cpu = cpumask_first(&avail);
301302
if (logical_cpu >= nr_cpu_ids)
302303
return 0;
303-
for (cpu_id = 0; cpu_id <= 65535; cpu_id++) {
304+
for (cpu_id = 0; cpu_id <= MAX_CPU_ADDRESS; cpu_id++) {
304305
if (cpu_known(cpu_id))
305306
continue;
306307
__cpu_logical_map[logical_cpu] = cpu_id;
@@ -379,7 +380,7 @@ static void __init smp_detect_cpus(void)
379380
/* Use sigp detection algorithm if sclp doesn't work. */
380381
if (sclp_get_cpu_info(info)) {
381382
smp_use_sigp_detection = 1;
382-
for (cpu = 0; cpu <= 65535; cpu++) {
383+
for (cpu = 0; cpu <= MAX_CPU_ADDRESS; cpu++) {
383384
if (cpu == boot_cpu_addr)
384385
continue;
385386
__cpu_logical_map[CPU_INIT_NO] = cpu;

0 commit comments

Comments
 (0)