mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Suresh Siddha <suresh.b.siddha@intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	yinghai@kernel.org, stable@kernel.org, suresh.b.siddha@intel.com,
	tglx@linutronix.de, shaohui.zheng@intel.com
Subject: [tip:x86/urgent] x86, apic: Don't use logical-flat mode when CPU hotplug may exceed 8 CPUs
Date: Tue, 9 Feb 2010 18:00:39 GMT	[thread overview]
Message-ID: <tip-418f727639cfc8f03068aae09f473c493c759b9b@git.kernel.org> (raw)
In-Reply-To: <20100118201256.672679042@sbs-t61.sc.intel.com>

Commit-ID:  418f727639cfc8f03068aae09f473c493c759b9b
Gitweb:     http://git.kernel.org/tip/418f727639cfc8f03068aae09f473c493c759b9b
Author:     Suresh Siddha <suresh.b.siddha@intel.com>
AuthorDate: Tue, 9 Feb 2010 09:18:35 -0800
Committer:  H. Peter Anvin <hpa@zytor.com>
CommitDate: Tue, 9 Feb 2010 09:29:17 -0800

x86, apic: Don't use logical-flat mode when CPU hotplug may exceed 8 CPUs

We need to fall back from logical-flat APIC mode to physical-flat mode
when we have more than 8 CPUs.  However, in the presence of CPU
hotplug, we have to consider the number of possible CPUs rather than
the number of current CPUs; otherwise we may cross the 8-CPU boundary
when CPUs are added later.

Reported-by: Shaohui Zheng <shaohui.zheng@intel.com>
Acked-by: Shaohui Zheng <shaohui.zheng@intel.com>
Cc: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <20100118201256.672679042@sbs-t61.sc.intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: <stable@kernel.org>
---
 arch/x86/kernel/apic/apic.c     |    2 +-
 arch/x86/kernel/apic/probe_64.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 3987e44..fc1d579 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1892,7 +1892,7 @@ void __cpuinit generic_processor_info(int apicid, int version)
 		max_physical_apicid = apicid;
 
 #ifdef CONFIG_X86_32
-	if (num_processors > 8) {
+	if (num_possible_cpus() > 8) {
 		switch (boot_cpu_data.x86_vendor) {
 		case X86_VENDOR_INTEL:
 			if (!APIC_XAPIC(version)) {
diff --git a/arch/x86/kernel/apic/probe_64.c b/arch/x86/kernel/apic/probe_64.c
index 450fe20..83e9be4 100644
--- a/arch/x86/kernel/apic/probe_64.c
+++ b/arch/x86/kernel/apic/probe_64.c
@@ -67,7 +67,7 @@ void __init default_setup_apic_routing(void)
 	}
 #endif
 
-	if (apic == &apic_flat && num_processors > 8)
+	if (apic == &apic_flat && num_possible_cpus() > 8)
 			apic = &apic_physflat;
 
 	printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);

  reply	other threads:[~2010-02-09 18:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-18 20:10 [patch 1/2] x86, apic: use physical mode for IBM summit platforms Suresh Siddha
2010-01-18 20:10 ` [patch 2/2] x86, apic: use logical flat for systems with <= 8 logical cpus Suresh Siddha
2010-02-09 18:00   ` tip-bot for Suresh Siddha [this message]
2010-02-09 18:47     ` [tip:x86/urgent] x86, apic: Don't use logical-flat mode when CPU hotplug may exceed 8 CPUs Yinghai Lu
2010-02-10  2:01       ` Suresh Siddha
2010-02-10  2:26         ` Yinghai Lu
2010-02-10  3:00           ` Yinghai Lu
2010-02-10  3:03             ` H. Peter Anvin
2010-02-10  3:04               ` Yinghai Lu
2010-02-10  3:42         ` Yinghai Lu
2010-02-10  6:27         ` tip-bot for Suresh Siddha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-418f727639cfc8f03068aae09f473c493c759b9b@git.kernel.org \
    --to=suresh.b.siddha@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=shaohui.zheng@intel.com \
    --cc=stable@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome