aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshok Raj <ashok.raj@intel.com>2006-02-16 17:01:48 -0500
committerTony Luck <tony.luck@intel.com>2006-02-16 17:10:50 -0500
commit8f8b1138fc9f65e3591aac83a4ee394fef34ac1d (patch)
tree2c4d34391681cb5aa5ed8e5f2def1502a8a4b333
parent6f6d75825dc49b082906b84537b4df28293c2977 (diff)
[IA64] Count disabled cpus as potential hot-pluggable CPUs
Minor updates to earlier patch. - Added to documentation to add ia64 as well. - Minor clarification on how to use disabled cpus - used plain max instead of max_t per Andew Morton. Signed-off-by: Ashok Raj <ashok.raj@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--Documentation/cpu-hotplug.txt14
-rw-r--r--arch/ia64/kernel/acpi.c19
2 files changed, 20 insertions, 13 deletions
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt
index 08c5d04f3086..e05278087ffa 100644
--- a/Documentation/cpu-hotplug.txt
+++ b/Documentation/cpu-hotplug.txt
@@ -44,10 +44,20 @@ maxcpus=n Restrict boot time cpus to n. Say if you have 4 cpus, using
44 maxcpus=2 will only boot 2. You can choose to bring the 44 maxcpus=2 will only boot 2. You can choose to bring the
45 other cpus later online, read FAQ's for more info. 45 other cpus later online, read FAQ's for more info.
46 46
47additional_cpus=n [x86_64 only] use this to limit hotpluggable cpus. 47additional_cpus*=n Use this to limit hotpluggable cpus. This option sets
48 This option sets
49 cpu_possible_map = cpu_present_map + additional_cpus 48 cpu_possible_map = cpu_present_map + additional_cpus
50 49
50(*) Option valid only for following architectures
51- x86_64, ia64
52
53ia64 and x86_64 use the number of disabled local apics in ACPI tables MADT
54to determine the number of potentially hot-pluggable cpus. The implementation
55should only rely on this to count the #of cpus, but *MUST* not rely on the
56apicid values in those tables for disabled apics. In the event BIOS doesnt
57mark such hot-pluggable cpus as disabled entries, one could use this
58parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map.
59
60
51CPU maps and such 61CPU maps and such
52----------------- 62-----------------
53[More on cpumaps and primitive to manipulate, please check 63[More on cpumaps and primitive to manipulate, please check
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 34795ede72e0..ecd44bdc8394 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -794,24 +794,21 @@ __init void prefill_possible_map(void)
794 int possible, disabled_cpus; 794 int possible, disabled_cpus;
795 795
796 disabled_cpus = total_cpus - available_cpus; 796 disabled_cpus = total_cpus - available_cpus;
797
797 if (additional_cpus == -1) { 798 if (additional_cpus == -1) {
798 if (disabled_cpus > 0) { 799 if (disabled_cpus > 0)
799 possible = total_cpus;
800 additional_cpus = disabled_cpus; 800 additional_cpus = disabled_cpus;
801 } 801 else
802 else {
803 possible = available_cpus;
804 additional_cpus = 0; 802 additional_cpus = 0;
805 } 803 }
806 } else { 804
807 possible = available_cpus + additional_cpus; 805 possible = available_cpus + additional_cpus;
808 } 806
809 if (possible > NR_CPUS) 807 if (possible > NR_CPUS)
810 possible = NR_CPUS; 808 possible = NR_CPUS;
811 809
812 printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", 810 printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n",
813 possible, 811 possible, max((possible - available_cpus), 0));
814 max_t(int, additional_cpus, 0));
815 812
816 for (i = 0; i < possible; i++) 813 for (i = 0; i < possible; i++)
817 cpu_set(i, cpu_possible_map); 814 cpu_set(i, cpu_possible_map);