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

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] s390: possible_cpus parameter

Introduce possible_cpus command line option. Hard sets the number of bits set
in cpu_possible_map. Unlike the additional_cpus parameter this one guarantees
that num_possible_cpus() will stay constant even if the system gets rebooted
and a different number of cpus are present at startup.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Heiko Carstens and committed by
Linus Torvalds
37a33026 255acee7

+17 -3
+6
Documentation/cpu-hotplug.txt
··· 58 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 67 CPU maps and such 62 68 ----------------- 63 69 [More on cpumaps and primitive to manipulate, please check
+11 -3
arch/s390/kernel/smp.c
··· 673 673 } 674 674 675 675 static unsigned int __initdata additional_cpus; 676 + static unsigned int __initdata possible_cpus; 676 677 677 678 void __init smp_setup_cpu_possible_map(void) 678 679 { 679 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 - pcpus = NR_CPUS; 684 + if (possible_cpus) 685 + pcpus = min(possible_cpus, (unsigned int) NR_CPUS); 685 686 686 687 for (cpu = 0; cpu < pcpus; cpu++) 687 688 cpu_set(cpu, cpu_possible_map); ··· 698 697 return 0; 699 698 } 700 699 early_param("additional_cpus", setup_additional_cpus); 700 + 701 + static int __init setup_possible_cpus(char *s) 702 + { 703 + possible_cpus = simple_strtoul(s, NULL, 0); 704 + return 0; 705 + } 706 + early_param("possible_cpus", setup_possible_cpus); 701 707 702 708 int 703 709 __cpu_disable(void)