All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] x86/smpboot: Check APIC ID before setting up default routing
@ 2016-08-19  3:22 Wei Jiangang
  2016-08-19  3:22 ` [PATCH v2 2/2] x86/apic: Update comment about disabling processor focus Wei Jiangang
  2016-08-24 13:01 ` [tip:x86/apic] x86/smpboot: Check APIC ID before setting up default routing tip-bot for Wei Jiangang
  0 siblings, 2 replies; 4+ messages in thread
From: Wei Jiangang @ 2016-08-19  3:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, tglx, mingo, hpa, bp, Wei Jiangang

This is not a bugfix, but code optimization.

If the BSP's APIC ID in local APIC is unexpected,
a kernel panic will occur and the system will halt.
That means no need to enable APIC mode, and no reason
to set up the default routing for APIC.

The combination of default_setup_apic_routing() and
apic_bsp_setup() are used to enable APIC mode.
They two should be kept together, rather than being
separated by the codes of checking APIC ID.
Just like their usage in APIC_init_uniprocessor().

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
---
 arch/x86/kernel/smpboot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 2a6e84a30a54..8216b997c1c9 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1316,14 +1316,13 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 		break;
 	}
 
-	default_setup_apic_routing();
-
 	if (read_apic_id() != boot_cpu_physical_apicid) {
 		panic("Boot APIC ID in local APIC unexpected (%d vs %d)",
 		     read_apic_id(), boot_cpu_physical_apicid);
 		/* Or can we switch back to PIC here? */
 	}
 
+	default_setup_apic_routing();
 	cpu0_logical_apicid = apic_bsp_setup(false);
 
 	pr_info("CPU%d: ", 0);
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] x86/apic: Update comment about disabling processor focus
  2016-08-19  3:22 [PATCH v2 1/2] x86/smpboot: Check APIC ID before setting up default routing Wei Jiangang
@ 2016-08-19  3:22 ` Wei Jiangang
  2016-08-24 13:01   ` [tip:x86/apic] " tip-bot for Wei Jiangang
  2016-08-24 13:01 ` [tip:x86/apic] x86/smpboot: Check APIC ID before setting up default routing tip-bot for Wei Jiangang
  1 sibling, 1 reply; 4+ messages in thread
From: Wei Jiangang @ 2016-08-19  3:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, tglx, mingo, hpa, bp, Wei Jiangang

Fix references to discarded end_level_ioapic_irq().

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
---
 arch/x86/kernel/apic/apic.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 20abd912f0e4..9d203712c146 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1350,7 +1350,6 @@ void setup_local_APIC(void)
 	 * Actually disabling the focus CPU check just makes the hang less
 	 * frequent as it makes the interrupt distributon model be more
 	 * like LRU than MRU (the short-term load is more even across CPUs).
-	 * See also the comment in end_level_ioapic_irq().  --macro
 	 */
 
 	/*
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [tip:x86/apic] x86/smpboot: Check APIC ID before setting up default routing
  2016-08-19  3:22 [PATCH v2 1/2] x86/smpboot: Check APIC ID before setting up default routing Wei Jiangang
  2016-08-19  3:22 ` [PATCH v2 2/2] x86/apic: Update comment about disabling processor focus Wei Jiangang
@ 2016-08-24 13:01 ` tip-bot for Wei Jiangang
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Wei Jiangang @ 2016-08-24 13:01 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: peterz, hpa, linux-kernel, tglx, torvalds, weijg.fnst, mingo

Commit-ID:  384d9fe3741657c8ed8cd9bf30bc1d4611864d56
Gitweb:     http://git.kernel.org/tip/384d9fe3741657c8ed8cd9bf30bc1d4611864d56
Author:     Wei Jiangang <weijg.fnst@cn.fujitsu.com>
AuthorDate: Fri, 19 Aug 2016 11:22:36 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 24 Aug 2016 11:24:33 +0200

x86/smpboot: Check APIC ID before setting up default routing

This is not a bugfix, but code optimization.

If the BSP's APIC ID in local APIC is unexpected,
a kernel panic will occur and the system will halt.
That means no need to enable APIC mode, and no reason
to set up the default routing for APIC.

The combination of default_setup_apic_routing() and
apic_bsp_setup() are used to enable APIC mode.
They two should be kept together, rather than being
separated by the codes of checking APIC ID.
Just like their usage in APIC_init_uniprocessor().

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@suse.de
Link: http://lkml.kernel.org/r/1471576957-12961-1-git-send-email-weijg.fnst@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/smpboot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 2a6e84a..8216b99 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1316,14 +1316,13 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 		break;
 	}
 
-	default_setup_apic_routing();
-
 	if (read_apic_id() != boot_cpu_physical_apicid) {
 		panic("Boot APIC ID in local APIC unexpected (%d vs %d)",
 		     read_apic_id(), boot_cpu_physical_apicid);
 		/* Or can we switch back to PIC here? */
 	}
 
+	default_setup_apic_routing();
 	cpu0_logical_apicid = apic_bsp_setup(false);
 
 	pr_info("CPU%d: ", 0);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [tip:x86/apic] x86/apic: Update comment about disabling processor focus
  2016-08-19  3:22 ` [PATCH v2 2/2] x86/apic: Update comment about disabling processor focus Wei Jiangang
@ 2016-08-24 13:01   ` tip-bot for Wei Jiangang
  0 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Wei Jiangang @ 2016-08-24 13:01 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: peterz, mingo, tglx, torvalds, hpa, weijg.fnst, linux-kernel

Commit-ID:  5035da41996d346c648a65c1d7a9f6469c7d358a
Gitweb:     http://git.kernel.org/tip/5035da41996d346c648a65c1d7a9f6469c7d358a
Author:     Wei Jiangang <weijg.fnst@cn.fujitsu.com>
AuthorDate: Fri, 19 Aug 2016 11:22:37 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 24 Aug 2016 11:24:33 +0200

x86/apic: Update comment about disabling processor focus

Fix references to discarded end_level_ioapic_irq().

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@suse.de
Link: http://lkml.kernel.org/r/1471576957-12961-2-git-send-email-weijg.fnst@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/apic/apic.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 63b7484..1cbae30 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1374,7 +1374,6 @@ void setup_local_APIC(void)
 	 * Actually disabling the focus CPU check just makes the hang less
 	 * frequent as it makes the interrupt distributon model be more
 	 * like LRU than MRU (the short-term load is more even across CPUs).
-	 * See also the comment in end_level_ioapic_irq().  --macro
 	 */
 
 	/*

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-24 13:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-19  3:22 [PATCH v2 1/2] x86/smpboot: Check APIC ID before setting up default routing Wei Jiangang
2016-08-19  3:22 ` [PATCH v2 2/2] x86/apic: Update comment about disabling processor focus Wei Jiangang
2016-08-24 13:01   ` [tip:x86/apic] " tip-bot for Wei Jiangang
2016-08-24 13:01 ` [tip:x86/apic] x86/smpboot: Check APIC ID before setting up default routing tip-bot for Wei Jiangang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.