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

[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>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
4bb5e07b 53f8c573

+13 -7
+6
arch/s390/include/asm/cpu.h
··· 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 */
+1
arch/s390/kernel/head.S
··· 27 27 #include <asm/asm-offsets.h> 28 28 #include <asm/thread_info.h> 29 29 #include <asm/page.h> 30 + #include <asm/cpu.h> 30 31 31 32 #ifdef CONFIG_64BIT 32 33 #define ARCH_OFFSET 4
+3 -5
arch/s390/kernel/head64.S
··· 62 62 clr %r11,%r12 63 63 je 5f # no more space in prefix array 64 64 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 68 68 5: 69 69 lhi %r1,2 # mode 2 = esame (dump) 70 70 j 6f ··· 130 130 #ifdef CONFIG_ZFCPDUMP 131 131 .Lcurrent_cpu: 132 132 .long 0x0 133 - .Llast_cpu: 134 - .long 0x0000ffff 135 133 .Lpref_arr_ptr: 136 134 .long zfcpdump_prefix_array 137 135 #endif /* CONFIG_ZFCPDUMP */
+3 -2
arch/s390/kernel/smp.c
··· 49 49 #include <asm/sclp.h> 50 50 #include <asm/cputime.h> 51 51 #include <asm/vdso.h> 52 + #include <asm/cpu.h> 52 53 #include "entry.h" 53 54 54 55 static struct task_struct *current_set[NR_CPUS]; ··· 301 300 logical_cpu = cpumask_first(&avail); 302 301 if (logical_cpu >= nr_cpu_ids) 303 302 return 0; 304 - for (cpu_id = 0; cpu_id <= 65535; cpu_id++) { 303 + for (cpu_id = 0; cpu_id <= MAX_CPU_ADDRESS; cpu_id++) { 305 304 if (cpu_known(cpu_id)) 306 305 continue; 307 306 __cpu_logical_map[logical_cpu] = cpu_id; ··· 380 379 /* Use sigp detection algorithm if sclp doesn't work. */ 381 380 if (sclp_get_cpu_info(info)) { 382 381 smp_use_sigp_detection = 1; 383 - for (cpu = 0; cpu <= 65535; cpu++) { 382 + for (cpu = 0; cpu <= MAX_CPU_ADDRESS; cpu++) { 384 383 if (cpu == boot_cpu_addr) 385 384 continue; 386 385 __cpu_logical_map[CPU_INIT_NO] = cpu;