diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2014-03-10 09:50:16 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2014-03-17 10:53:06 -0400 |
commit | cf813db0b448b45b454f0983329c3c7b007f9ab7 (patch) | |
tree | 2ccbddbc0c1494d92e4fa4f1c2f7d337595e1dd2 /arch/s390/kernel/smp.c | |
parent | 36a554021b44d146178ae98e598c9502a1269f7d (diff) |
s390/smp: limit number of cpus in possible cpu mask
Limit the number of bits to the maximum number of cpus a machine
can have.
possible_cpu_mask typically will have more bits set than a machine
may physically have. This results in wasted memory during per-cpu
memory allocations, if the possible mask contains more cpus than
physically possible for a given configuration.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/smp.c')
-rw-r--r-- | arch/s390/kernel/smp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index a7125b62a9a6..8827883310dd 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -773,11 +773,11 @@ void __noreturn cpu_die(void) | |||
773 | 773 | ||
774 | void __init smp_fill_possible_mask(void) | 774 | void __init smp_fill_possible_mask(void) |
775 | { | 775 | { |
776 | unsigned int possible, cpu; | 776 | unsigned int possible, sclp, cpu; |
777 | 777 | ||
778 | possible = setup_possible_cpus; | 778 | sclp = sclp_get_max_cpu() ?: nr_cpu_ids; |
779 | if (!possible) | 779 | possible = setup_possible_cpus ?: nr_cpu_ids; |
780 | possible = MACHINE_IS_VM ? 64 : nr_cpu_ids; | 780 | possible = min(possible, sclp); |
781 | for (cpu = 0; cpu < possible && cpu < nr_cpu_ids; cpu++) | 781 | for (cpu = 0; cpu < possible && cpu < nr_cpu_ids; cpu++) |
782 | set_cpu_possible(cpu, true); | 782 | set_cpu_possible(cpu, true); |
783 | } | 783 | } |