summaryrefslogtreecommitdiff
path: root/arch/ia64/kernel/acpi.c
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2006-02-15 15:17:57 -0800
committerTony Luck <tony.luck@intel.com>2006-02-15 15:17:57 -0800
commit72166c35f0e15e5081e51304de48e73f8fdf5498 (patch)
tree0515dfa0fc442f92ecbb9add2bc53ca86016a8d6 /arch/ia64/kernel/acpi.c
parentb05de01ae1c76b7d61da21bbcc26345bf7a9052f (diff)
parenta6b14fa6fdc01ab3519c2729624f808677539b59 (diff)
downloadlwn-72166c35f0e15e5081e51304de48e73f8fdf5498.tar.gz
lwn-72166c35f0e15e5081e51304de48e73f8fdf5498.zip
Pull fix-cpu-possible-map into release branch
Diffstat (limited to 'arch/ia64/kernel/acpi.c')
-rw-r--r--arch/ia64/kernel/acpi.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index d2702c419cf8..34795ede72e0 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -761,6 +761,62 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
return (0);
}
+int additional_cpus __initdata = -1;
+
+static __init int setup_additional_cpus(char *s)
+{
+ if (s)
+ additional_cpus = simple_strtol(s, NULL, 0);
+
+ return 0;
+}
+
+early_param("additional_cpus", setup_additional_cpus);
+
+/*
+ * cpu_possible_map should be static, it cannot change as cpu's
+ * are onlined, or offlined. The reason is per-cpu data-structures
+ * are allocated by some modules at init time, and dont expect to
+ * do this dynamically on cpu arrival/departure.
+ * cpu_present_map on the other hand can change dynamically.
+ * In case when cpu_hotplug is not compiled, then we resort to current
+ * behaviour, which is cpu_possible == cpu_present.
+ * - Ashok Raj
+ *
+ * Three ways to find out the number of additional hotplug CPUs:
+ * - If the BIOS specified disabled CPUs in ACPI/mptables use that.
+ * - The user can overwrite it with additional_cpus=NUM
+ * - Otherwise don't reserve additional CPUs.
+ */
+__init void prefill_possible_map(void)
+{
+ int i;
+ int possible, disabled_cpus;
+
+ disabled_cpus = total_cpus - available_cpus;
+ if (additional_cpus == -1) {
+ if (disabled_cpus > 0) {
+ possible = total_cpus;
+ additional_cpus = disabled_cpus;
+ }
+ else {
+ possible = available_cpus;
+ additional_cpus = 0;
+ }
+ } else {
+ possible = available_cpus + additional_cpus;
+ }
+ if (possible > NR_CPUS)
+ possible = NR_CPUS;
+
+ printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n",
+ possible,
+ max_t(int, additional_cpus, 0));
+
+ for (i = 0; i < possible; i++)
+ cpu_set(i, cpu_possible_map);
+}
+
int acpi_map_lsapic(acpi_handle handle, int *pcpu)
{
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };