aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2011-07-08 13:19:26 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2011-07-08 18:33:35 -0400
commit14cb6dcf0a023f5977461c94d8d5a163c937979b (patch)
tree5e05e51b0caed5485cf027a37878952e6aba3ab8 /arch
parentfe0d42203cb5616eeff68b14576a0f7e2dd56625 (diff)
x86, boot: Wait for boot cpu to show up if nr_cpus limit is about to hit
nr_cpus allows one to specify number of possible cpus in the system. Current assumption seems to be that first cpu to show up is boot cpu and this assumption will be broken in kdump scenario where we can be booting on a non boot cpu with nr_cpus=1. It might happen that first cpu we parse is not the cpu we boot on and later we ignore boot cpu. Though code later seems to recognize this anomaly and forcibly sets boot cpu in physical cpu map with following warning. if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) { printk(KERN_WARNING "weird, boot CPU (#%d) not listed by the BIOS.\n", hard_smp_processor_id()); physid_set(hard_smp_processor_id(), phys_cpu_present_map); } This patch waits for boot cpu to show up and starts ignoring the cpus once we have hit (nr_cpus - 1) number of cpus. So effectively we are reserving one slot out of nr_cpus for boot cpu explicitly. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Acked-by: Yinghai Lu <yinghai@kernel.org> Link: http://lkml.kernel.org/r/20110708171926.GF2930@redhat.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/apic/apic.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index b9338b8cf420..68219a919dfd 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1943,10 +1943,28 @@ void disconnect_bsp_APIC(int virt_wire_setup)
1943 1943
1944void __cpuinit generic_processor_info(int apicid, int version) 1944void __cpuinit generic_processor_info(int apicid, int version)
1945{ 1945{
1946 int cpu; 1946 int cpu, max = nr_cpu_ids;
1947 bool boot_cpu_detected = physid_isset(boot_cpu_physical_apicid,
1948 phys_cpu_present_map);
1949
1950 /*
1951 * If boot cpu has not been detected yet, then only allow upto
1952 * nr_cpu_ids - 1 processors and keep one slot free for boot cpu
1953 */
1954 if (!boot_cpu_detected && num_processors >= nr_cpu_ids - 1 &&
1955 apicid != boot_cpu_physical_apicid) {
1956 int thiscpu = max + disabled_cpus - 1;
1957
1958 pr_warning(
1959 "ACPI: NR_CPUS/possible_cpus limit of %i almost"
1960 " reached. Keeping one slot for boot cpu."
1961 " Processor %d/0x%x ignored.\n", max, thiscpu, apicid);
1962
1963 disabled_cpus++;
1964 return;
1965 }
1947 1966
1948 if (num_processors >= nr_cpu_ids) { 1967 if (num_processors >= nr_cpu_ids) {
1949 int max = nr_cpu_ids;
1950 int thiscpu = max + disabled_cpus; 1968 int thiscpu = max + disabled_cpus;
1951 1969
1952 pr_warning( 1970 pr_warning(