public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing
@ 2016-08-17  6:42 Wei Jiangang
  2016-08-17  6:42 ` [PATCH 2/2] x86/apic: Update comment about disabling processor focus Wei Jiangang
  2016-08-18  9:47 ` [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing Ingo Molnar
  0 siblings, 2 replies; 4+ messages in thread
From: Wei Jiangang @ 2016-08-17  6:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, tglx, mingo, hpa, bp, Wei Jiangang

Check the boot APIC ID firstly,
and then setup the default routing of APIC looks better.

And move default_setup_apic_routing() close to apic_bsp_setup(),
which staying in step with the codes 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 2/2] x86/apic: Update comment about disabling processor focus
  2016-08-17  6:42 [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing Wei Jiangang
@ 2016-08-17  6:42 ` Wei Jiangang
  2016-08-18  9:47 ` [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing Ingo Molnar
  1 sibling, 0 replies; 4+ messages in thread
From: Wei Jiangang @ 2016-08-17  6:42 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

* Re: [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing
  2016-08-17  6:42 [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing Wei Jiangang
  2016-08-17  6:42 ` [PATCH 2/2] x86/apic: Update comment about disabling processor focus Wei Jiangang
@ 2016-08-18  9:47 ` Ingo Molnar
  2016-08-18 10:15   ` Wei, Jiangang
  1 sibling, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2016-08-18  9:47 UTC (permalink / raw)
  To: Wei Jiangang; +Cc: linux-kernel, x86, tglx, mingo, hpa, bp


* Wei Jiangang <weijg.fnst@cn.fujitsu.com> wrote:

> Check the boot APIC ID firstly,
> and then setup the default routing of APIC looks better.
> 
> And move default_setup_apic_routing() close to apic_bsp_setup(),
> which staying in step with the codes 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(-)

If it's not a bug then please clearly note so in the changelog and
explain why the change results in better code.

If it's fixing a bug/misfeature then please fix the changelog to
conform to the standard changelog style:

 - first describe the symptoms of the bug - how does a user notice? 

 - then describe how the code behaves today and how that is causing the bug

 - and then only describe how it's fixed.

Thanks,

        Ingo

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

* Re: [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing
  2016-08-18  9:47 ` [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing Ingo Molnar
@ 2016-08-18 10:15   ` Wei, Jiangang
  0 siblings, 0 replies; 4+ messages in thread
From: Wei, Jiangang @ 2016-08-18 10:15 UTC (permalink / raw)
  To: mingo@kernel.org
  Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com,
	mingo@redhat.com, x86@kernel.org, bp@suse.de

On Thu, 2016-08-18 at 11:47 +0200, Ingo Molnar wrote:
> * Wei Jiangang <weijg.fnst@cn.fujitsu.com> wrote:
> 
> > Check the boot APIC ID firstly,
> > and then setup the default routing of APIC looks better.
> > 
> > And move default_setup_apic_routing() close to apic_bsp_setup(),
> > which staying in step with the codes 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(-)
> 
> If it's not a bug then please clearly note so in the changelog and
> explain why the change results in better code.

It's not a bug.
The combination of default_setup_apic_routing() and apic_bsp_setup() is
used to enable APIC mode. If the return of read_apic_id() is not equal
to boot_cpu_physical_apicid, it means the APIC ID of current CPU‘s local
APIC  is unexpected and enable APIC mode maybe fail. so no need to set
up the apic routing.  That's why I want to move
default_setup_apic_routing() behind checking the boot APIC ID.

Sorry for obscure commit message. I will improve it in next version.

> 
> If it's fixing a bug/misfeature then please fix the changelog to
> conform to the standard changelog style:
> 
>  - first describe the symptoms of the bug - how does a user notice? 
> 
>  - then describe how the code behaves today and how that is causing the bug
> 
>  - and then only describe how it's fixed.

Thanks for your detailed explanation. I'll keep in my mind.
> 
> Thanks,
> 
>         Ingo
> 
> 

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

end of thread, other threads:[~2016-08-18 10:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-17  6:42 [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing Wei Jiangang
2016-08-17  6:42 ` [PATCH 2/2] x86/apic: Update comment about disabling processor focus Wei Jiangang
2016-08-18  9:47 ` [PATCH 1/2] x86/smpboot: Check APIC ID before setting up default routing Ingo Molnar
2016-08-18 10:15   ` Wei, Jiangang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox