aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-12-17 18:21:39 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-18 06:08:05 -0500
commit3b11ce7f542e415c90267b4482d4611410b468e6 (patch)
tree26366b9f25af830b71c78504bbadd94896a8b82a /arch
parenta775a38b1353161a6d7af86b667d6523c12c1a37 (diff)
x86: use possible_cpus=NUM to extend the possible cpus allowed
Impact: add new boot parameter Use possible_cpus=NUM kernel parameter to extend the number of possible cpus. The ability to HOTPLUG ON cpus that are "possible" but not "present" is dealt with in a later patch. Signed-off-by: Mike Travis <travis@sgi.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/apic.c20
-rw-r--r--arch/x86/kernel/smpboot.c25
2 files changed, 33 insertions, 12 deletions
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index 93cf2d13f335..f7a32a3beb2f 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -1819,28 +1819,32 @@ void disconnect_bsp_APIC(int virt_wire_setup)
1819void __cpuinit generic_processor_info(int apicid, int version) 1819void __cpuinit generic_processor_info(int apicid, int version)
1820{ 1820{
1821 int cpu; 1821 int cpu;
1822 cpumask_t tmp_map;
1823 1822
1824 /* 1823 /*
1825 * Validate version 1824 * Validate version
1826 */ 1825 */
1827 if (version == 0x0) { 1826 if (version == 0x0) {
1828 pr_warning("BIOS bug, APIC version is 0 for CPU#%d! " 1827 pr_warning("BIOS bug, APIC version is 0 for CPU#%d! "
1829 "fixing up to 0x10. (tell your hw vendor)\n", 1828 "fixing up to 0x10. (tell your hw vendor)\n",
1830 version); 1829 version);
1831 version = 0x10; 1830 version = 0x10;
1832 } 1831 }
1833 apic_version[apicid] = version; 1832 apic_version[apicid] = version;
1834 1833
1835 if (num_processors >= NR_CPUS) { 1834 if (num_processors >= nr_cpu_ids) {
1836 pr_warning("WARNING: NR_CPUS limit of %i reached." 1835 int max = nr_cpu_ids;
1837 " Processor ignored.\n", NR_CPUS); 1836 int thiscpu = max + disabled_cpus;
1837
1838 pr_warning(
1839 "ACPI: NR_CPUS/possible_cpus limit of %i reached."
1840 " Processor %d/0x%x ignored.\n", max, thiscpu, apicid);
1841
1842 disabled_cpus++;
1838 return; 1843 return;
1839 } 1844 }
1840 1845
1841 num_processors++; 1846 num_processors++;
1842 cpus_complement(tmp_map, cpu_present_map); 1847 cpu = cpumask_next_zero(-1, cpu_present_mask);
1843 cpu = first_cpu(tmp_map);
1844 1848
1845 physid_set(apicid, phys_cpu_present_map); 1849 physid_set(apicid, phys_cpu_present_map);
1846 if (apicid == boot_cpu_physical_apicid) { 1850 if (apicid == boot_cpu_physical_apicid) {
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index be9466788043..1a9941b11150 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1252,6 +1252,15 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
1252 check_nmi_watchdog(); 1252 check_nmi_watchdog();
1253} 1253}
1254 1254
1255static int __initdata setup_possible_cpus = -1;
1256static int __init _setup_possible_cpus(char *str)
1257{
1258 get_option(&str, &setup_possible_cpus);
1259 return 0;
1260}
1261early_param("possible_cpus", _setup_possible_cpus);
1262
1263
1255/* 1264/*
1256 * cpu_possible_map should be static, it cannot change as cpu's 1265 * cpu_possible_map should be static, it cannot change as cpu's
1257 * are onlined, or offlined. The reason is per-cpu data-structures 1266 * are onlined, or offlined. The reason is per-cpu data-structures
@@ -1264,7 +1273,7 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
1264 * 1273 *
1265 * Three ways to find out the number of additional hotplug CPUs: 1274 * Three ways to find out the number of additional hotplug CPUs:
1266 * - If the BIOS specified disabled CPUs in ACPI/mptables use that. 1275 * - If the BIOS specified disabled CPUs in ACPI/mptables use that.
1267 * - The user can overwrite it with additional_cpus=NUM 1276 * - The user can overwrite it with possible_cpus=NUM
1268 * - Otherwise don't reserve additional CPUs. 1277 * - Otherwise don't reserve additional CPUs.
1269 * We do this because additional CPUs waste a lot of memory. 1278 * We do this because additional CPUs waste a lot of memory.
1270 * -AK 1279 * -AK
@@ -1277,9 +1286,17 @@ __init void prefill_possible_map(void)
1277 if (!num_processors) 1286 if (!num_processors)
1278 num_processors = 1; 1287 num_processors = 1;
1279 1288
1280 possible = num_processors + disabled_cpus; 1289 if (setup_possible_cpus == -1)
1281 if (possible > NR_CPUS) 1290 possible = num_processors + disabled_cpus;
1282 possible = NR_CPUS; 1291 else
1292 possible = setup_possible_cpus;
1293
1294 if (possible > CONFIG_NR_CPUS) {
1295 printk(KERN_WARNING
1296 "%d Processors exceeds NR_CPUS limit of %d\n",
1297 possible, CONFIG_NR_CPUS);
1298 possible = CONFIG_NR_CPUS;
1299 }
1283 1300
1284 printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", 1301 printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n",
1285 possible, max_t(int, possible - num_processors, 0)); 1302 possible, max_t(int, possible - num_processors, 0));