All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Cc: mm-commits@vger.kernel.org, ak@suse.de, ashok.raj@intel.com,
	akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] genapic: default to physical mode on hotplug CPU kernels
Date: Wed, 29 Nov 2006 08:10:23 +0100	[thread overview]
Message-ID: <20061129071023.GA651@elte.hu> (raw)
In-Reply-To: <20061128143145.B16460@unix-os.sc.intel.com>


* Siddha, Suresh B <suresh.b.siddha@intel.com> wrote:

> On Tue, Nov 28, 2006 at 09:23:22PM +0100, Ingo Molnar wrote:
> > 
> > * Siddha, Suresh B <suresh.b.siddha@intel.com> wrote:
> > 
> > > On Tue, Nov 28, 2006 at 07:33:46AM +0100, Ingo Molnar wrote:
> > > > -	if (clusters <= 1 && max_cluster <= 8 && cluster_cnt[0] == max_cluster)
> > > > +	if (max_apic < 8)
> > > 
> > > Patch mostly looks good.  Instead of checking for max_apic, can we use
> > > 	cpus_weight(cpu_possible_map) <= 8
> > 
> > ok - but i think it's still possible the BIOS tells us APIC IDs that are 
> > larger than 7, even if there are fewer CPUs. So i think the patch below 
> > should cover it. Agreed?
> > 
> 
> I think it is ok to use flat mode even when APIC IDs are larger than 
> 7, as we rely on LDR's which are programmed using smp_processor_id().
> 
> IMO, cpus_weight check should be fine.

hm - indeed. Then we can indeed do the patch below. Nice simplification!

	Ingo

-------------------->
From: Ingo Molnar <mingo@elte.hu>
Subject: [patch] genapic: default to physical mode on hotplug CPU kernels

default to physical mode on hotplug CPU kernels. Furher simplify and
clean up the APIC initialization code.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86_64/kernel/genapic.c |   20 +++-----------------
 arch/x86_64/kernel/mpparse.c |    2 +-
 include/asm-x86_64/apic.h    |    2 +-
 3 files changed, 5 insertions(+), 19 deletions(-)

Index: linux/arch/x86_64/kernel/genapic.c
===================================================================
--- linux.orig/arch/x86_64/kernel/genapic.c
+++ linux/arch/x86_64/kernel/genapic.c
@@ -33,25 +33,11 @@ u8 x86_cpu_to_log_apicid[NR_CPUS]	= { [0
 struct genapic __read_mostly *genapic = &apic_flat;
 
 /*
- * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
+ * Choose the APIC routing mode:
  */
-void __init clustered_apic_check(void)
+void __init setup_apic_routing(void)
 {
-	unsigned int i, max_apic = 0;
-	u8 id;
-
-	/*
-	 * Determine the maximum APIC ID in use:
-	 */
-	for (i = 0; i < NR_CPUS; i++) {
-		id = bios_cpu_apicid[i];
-		if (id == BAD_APICID)
-			continue;
-		if (id > max_apic)
-			max_apic = id;
-	}
-
-	if (max_apic < 8)
+	if (cpus_weight(cpu_possible_map) <= 8)
 		genapic = &apic_flat;
 	else
 		genapic = &apic_physflat;
Index: linux/arch/x86_64/kernel/mpparse.c
===================================================================
--- linux.orig/arch/x86_64/kernel/mpparse.c
+++ linux/arch/x86_64/kernel/mpparse.c
@@ -302,7 +302,7 @@ static int __init smp_read_mpc(struct mp
 			}
 		}
 	}
-	clustered_apic_check();
+	setup_apic_routing();
 	if (!num_processors)
 		printk(KERN_ERR "MPTABLE: no processors registered!\n");
 	return num_processors;
Index: linux/include/asm-x86_64/apic.h
===================================================================
--- linux.orig/include/asm-x86_64/apic.h
+++ linux/include/asm-x86_64/apic.h
@@ -82,7 +82,7 @@ extern void setup_secondary_APIC_clock (
 extern int APIC_init_uniprocessor (void);
 extern void disable_APIC_timer(void);
 extern void enable_APIC_timer(void);
-extern void clustered_apic_check(void);
+extern void setup_apic_routing(void);
 static inline void lapic_timer_idle_broadcast(int broadcast) { }
 
 extern void setup_APIC_extened_lvt(unsigned char lvt_off, unsigned char vector,

  reply	other threads:[~2006-11-29  7:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200611140109.kAE19f5e014490@shell0.pdx.osdl.net>
     [not found] ` <20061127141849.A9978@unix-os.sc.intel.com>
     [not found]   ` <20061128063345.GA19523@elte.hu>
2006-11-28 19:14     ` [patch] genapic: always use physical delivery mode on > 8 CPUs Siddha, Suresh B
2006-11-28 20:23       ` [patch] genapic: default to physical mode on hotplug CPU kernels Ingo Molnar
2006-11-28 22:31         ` Siddha, Suresh B
2006-11-29  7:10           ` Ingo Molnar [this message]
2006-11-29  8:08             ` Ingo Molnar
2006-11-30  2:56               ` Siddha, Suresh B

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=20061129071023.GA651@elte.hu \
    --to=mingo@elte.hu \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=ashok.raj@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=suresh.b.siddha@intel.com \
    /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 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.