diff options
-rw-r--r-- | Documentation/kernel-parameters.txt | 6 | ||||
-rw-r--r-- | arch/ia64/kernel/acpi.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 7 | ||||
-rw-r--r-- | drivers/acpi/numa.c | 4 | ||||
-rw-r--r-- | init/main.c | 14 |
5 files changed, 28 insertions, 7 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 736d45602886..51bceb0fb277 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1772,6 +1772,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1772 | purges which is reported from either PAL_VM_SUMMARY or | 1772 | purges which is reported from either PAL_VM_SUMMARY or |
1773 | SAL PALO. | 1773 | SAL PALO. |
1774 | 1774 | ||
1775 | nr_cpus= [SMP] Maximum number of processors that an SMP kernel | ||
1776 | could support. nr_cpus=n : n >= 1 limits the kernel to | ||
1777 | supporting 'n' processors. Later in runtime you can not | ||
1778 | use hotplug cpu feature to put more cpu back to online. | ||
1779 | just like you compile the kernel NR_CPUS=n | ||
1780 | |||
1775 | nr_uarts= [SERIAL] maximum number of UARTs to be registered. | 1781 | nr_uarts= [SERIAL] maximum number of UARTs to be registered. |
1776 | 1782 | ||
1777 | numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA. | 1783 | numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA. |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 40574ae11401..605a08b29721 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -881,8 +881,8 @@ __init void prefill_possible_map(void) | |||
881 | 881 | ||
882 | possible = available_cpus + additional_cpus; | 882 | possible = available_cpus + additional_cpus; |
883 | 883 | ||
884 | if (possible > NR_CPUS) | 884 | if (possible > nr_cpu_ids) |
885 | possible = NR_CPUS; | 885 | possible = nr_cpu_ids; |
886 | 886 | ||
887 | printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", | 887 | printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", |
888 | possible, max((possible - available_cpus), 0)); | 888 | possible, max((possible - available_cpus), 0)); |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 678d0b8c26f3..eff2fe175422 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -1213,11 +1213,12 @@ __init void prefill_possible_map(void) | |||
1213 | 1213 | ||
1214 | total_cpus = max_t(int, possible, num_processors + disabled_cpus); | 1214 | total_cpus = max_t(int, possible, num_processors + disabled_cpus); |
1215 | 1215 | ||
1216 | if (possible > CONFIG_NR_CPUS) { | 1216 | /* nr_cpu_ids could be reduced via nr_cpus= */ |
1217 | if (possible > nr_cpu_ids) { | ||
1217 | printk(KERN_WARNING | 1218 | printk(KERN_WARNING |
1218 | "%d Processors exceeds NR_CPUS limit of %d\n", | 1219 | "%d Processors exceeds NR_CPUS limit of %d\n", |
1219 | possible, CONFIG_NR_CPUS); | 1220 | possible, nr_cpu_ids); |
1220 | possible = CONFIG_NR_CPUS; | 1221 | possible = nr_cpu_ids; |
1221 | } | 1222 | } |
1222 | 1223 | ||
1223 | printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", | 1224 | printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", |
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index 7ad48dfc12db..b8725461d887 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c | |||
@@ -279,9 +279,9 @@ int __init acpi_numa_init(void) | |||
279 | /* SRAT: Static Resource Affinity Table */ | 279 | /* SRAT: Static Resource Affinity Table */ |
280 | if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { | 280 | if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { |
281 | acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY, | 281 | acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY, |
282 | acpi_parse_x2apic_affinity, NR_CPUS); | 282 | acpi_parse_x2apic_affinity, nr_cpu_ids); |
283 | acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY, | 283 | acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY, |
284 | acpi_parse_processor_affinity, NR_CPUS); | 284 | acpi_parse_processor_affinity, nr_cpu_ids); |
285 | ret = acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY, | 285 | ret = acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY, |
286 | acpi_parse_memory_affinity, | 286 | acpi_parse_memory_affinity, |
287 | NR_NODE_MEMBLKS); | 287 | NR_NODE_MEMBLKS); |
diff --git a/init/main.c b/init/main.c index 845187822e5c..05b5283e98fa 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -149,6 +149,20 @@ static int __init nosmp(char *str) | |||
149 | 149 | ||
150 | early_param("nosmp", nosmp); | 150 | early_param("nosmp", nosmp); |
151 | 151 | ||
152 | /* this is hard limit */ | ||
153 | static int __init nrcpus(char *str) | ||
154 | { | ||
155 | int nr_cpus; | ||
156 | |||
157 | get_option(&str, &nr_cpus); | ||
158 | if (nr_cpus > 0 && nr_cpus < nr_cpu_ids) | ||
159 | nr_cpu_ids = nr_cpus; | ||
160 | |||
161 | return 0; | ||
162 | } | ||
163 | |||
164 | early_param("nr_cpus", nrcpus); | ||
165 | |||
152 | static int __init maxcpus(char *str) | 166 | static int __init maxcpus(char *str) |
153 | { | 167 | { |
154 | get_option(&str, &setup_max_cpus); | 168 | get_option(&str, &setup_max_cpus); |