Skip to content

Commit

Permalink
[IA64] Count disabled cpus as potential hot-pluggable CPUs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ashok Raj authored and Tony Luck committed Feb 16, 2006
1 parent 6f6d758 commit 8f8b113
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
14 changes: 12 additions & 2 deletions Documentation/cpu-hotplug.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,20 @@ maxcpus=n Restrict boot time cpus to n. Say if you have 4 cpus, using
maxcpus=2 will only boot 2. You can choose to bring the
other cpus later online, read FAQ's for more info.

additional_cpus=n [x86_64 only] use this to limit hotpluggable cpus.
This option sets
additional_cpus*=n Use this to limit hotpluggable cpus. This option sets
cpu_possible_map = cpu_present_map + additional_cpus

(*) Option valid only for following architectures
- x86_64, ia64

ia64 and x86_64 use the number of disabled local apics in ACPI tables MADT
to determine the number of potentially hot-pluggable cpus. The implementation
should only rely on this to count the #of cpus, but *MUST* not rely on the
apicid values in those tables for disabled apics. In the event BIOS doesnt
mark such hot-pluggable cpus as disabled entries, one could use this
parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map.


CPU maps and such
-----------------
[More on cpumaps and primitive to manipulate, please check
Expand Down
19 changes: 8 additions & 11 deletions arch/ia64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,24 +794,21 @@ __init void prefill_possible_map(void)
int possible, disabled_cpus;

disabled_cpus = total_cpus - available_cpus;

if (additional_cpus == -1) {
if (disabled_cpus > 0) {
possible = total_cpus;
if (disabled_cpus > 0)
additional_cpus = disabled_cpus;
}
else {
possible = available_cpus;
else
additional_cpus = 0;
}
} else {
possible = available_cpus + additional_cpus;
}
}

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));
possible, max((possible - available_cpus), 0));

for (i = 0; i < possible; i++)
cpu_set(i, cpu_possible_map);
Expand Down

0 comments on commit 8f8b113

Please sign in to comment.