diff options
-rw-r--r-- | Documentation/cpu-hotplug.txt | 6 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 14 |
2 files changed, 17 insertions, 3 deletions
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt index 4d3355da0e26..e71bc6cbbc5e 100644 --- a/Documentation/cpu-hotplug.txt +++ b/Documentation/cpu-hotplug.txt | |||
@@ -58,6 +58,12 @@ mark such hot-pluggable cpus as disabled entries, one could use this | |||
58 | parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map. | 58 | parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map. |
59 | 59 | ||
60 | 60 | ||
61 | possible_cpus=n [s390 only] use this to set hotpluggable cpus. | ||
62 | This option sets possible_cpus bits in | ||
63 | cpu_possible_map. Thus keeping the numbers of bits set | ||
64 | constant even if the machine gets rebooted. | ||
65 | This option overrides additional_cpus. | ||
66 | |||
61 | CPU maps and such | 67 | CPU maps and such |
62 | ----------------- | 68 | ----------------- |
63 | [More on cpumaps and primitive to manipulate, please check | 69 | [More on cpumaps and primitive to manipulate, please check |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 53291e94ac7b..d0a2745aec7f 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -673,15 +673,16 @@ __cpu_up(unsigned int cpu) | |||
673 | } | 673 | } |
674 | 674 | ||
675 | static unsigned int __initdata additional_cpus; | 675 | static unsigned int __initdata additional_cpus; |
676 | static unsigned int __initdata possible_cpus; | ||
676 | 677 | ||
677 | void __init smp_setup_cpu_possible_map(void) | 678 | void __init smp_setup_cpu_possible_map(void) |
678 | { | 679 | { |
679 | unsigned int pcpus, cpu; | 680 | unsigned int pcpus, cpu; |
680 | 681 | ||
681 | pcpus = smp_count_cpus() + additional_cpus; | 682 | pcpus = min(smp_count_cpus() + additional_cpus, (unsigned int) NR_CPUS); |
682 | 683 | ||
683 | if (pcpus > NR_CPUS) | 684 | if (possible_cpus) |
684 | pcpus = NR_CPUS; | 685 | pcpus = min(possible_cpus, (unsigned int) NR_CPUS); |
685 | 686 | ||
686 | for (cpu = 0; cpu < pcpus; cpu++) | 687 | for (cpu = 0; cpu < pcpus; cpu++) |
687 | cpu_set(cpu, cpu_possible_map); | 688 | cpu_set(cpu, cpu_possible_map); |
@@ -698,6 +699,13 @@ static int __init setup_additional_cpus(char *s) | |||
698 | } | 699 | } |
699 | early_param("additional_cpus", setup_additional_cpus); | 700 | early_param("additional_cpus", setup_additional_cpus); |
700 | 701 | ||
702 | static int __init setup_possible_cpus(char *s) | ||
703 | { | ||
704 | possible_cpus = simple_strtoul(s, NULL, 0); | ||
705 | return 0; | ||
706 | } | ||
707 | early_param("possible_cpus", setup_possible_cpus); | ||
708 | |||
701 | int | 709 | int |
702 | __cpu_disable(void) | 710 | __cpu_disable(void) |
703 | { | 711 | { |