public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ravikiran G Thirumalai <kiran@scalex86.org>
To: Andrew Morton <akpm@zip.com.au>
Cc: Andi Kleen <ak@suse.de>, linux-kernel@vger.kernel.org
Subject: [patch] x86_64: fix cpu_to_node setup for sparse apic_ids
Date: Wed, 27 Jul 2005 18:15:40 -0700	[thread overview]
Message-ID: <20050728011540.GA23923@localhost.localdomain> (raw)

While booting with SMT disabled in bios, when using acpi srat to setup
cpu_to_node[],  sparse apic_ids create problems.  Here's a fix for that.

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>

Index: linux-2.6.13-rc3/arch/x86_64/mm/srat.c
===================================================================
--- linux-2.6.13-rc3.orig/arch/x86_64/mm/srat.c	2005-06-17 12:48:29.000000000 -0700
+++ linux-2.6.13-rc3/arch/x86_64/mm/srat.c	2005-07-27 15:36:23.000000000 -0700
@@ -20,6 +20,9 @@
 
 static struct acpi_table_slit *acpi_slit;
 
+/* Internal processor count */
+static unsigned int __initdata num_processors = 0;
+
 static nodemask_t nodes_parsed __initdata;
 static nodemask_t nodes_found __initdata;
 static struct node nodes[MAX_NUMNODES] __initdata;
@@ -101,16 +104,18 @@
 		bad_srat();
 		return;
 	}
-	if (pa->apic_id >= NR_CPUS) {
-		printk(KERN_ERR "SRAT: lapic %u too large.\n",
-		       pa->apic_id);
+	if (num_processors >= NR_CPUS) {
+		printk(KERN_ERR "SRAT: Processor #%d (lapic %u) INVALID. (Max ID: %d).\n",
+			num_processors, pa->apic_id, NR_CPUS);
 		bad_srat();
 		return;
 	}
-	cpu_to_node[pa->apic_id] = node;
+	cpu_to_node[num_processors] = node;
 	acpi_numa = 1;
-	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
-	       pxm, pa->apic_id, node);
+	printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> CPU %u -> Node %u\n",
+	       pxm, pa->apic_id, num_processors, node);
+
+	num_processors++;
 }
 
 /* Callback for parsing of the Proximity Domain <-> Memory Area mappings */

             reply	other threads:[~2005-07-28  1:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-28  1:15 Ravikiran G Thirumalai [this message]
2005-07-28  1:24 ` [patch] x86_64: fix cpu_to_node setup for sparse apic_ids Andrew Morton
2005-07-28  1:50   ` Ravikiran G Thirumalai
2005-07-29  7:46   ` Andi Kleen
2005-08-01 22:07     ` [PATCH] MM, NUMA : sys_set_mempolicy() doesnt check if mode < 0 Eric Dumazet
2005-08-03  9:13       ` Andi Kleen

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=20050728011540.GA23923@localhost.localdomain \
    --to=kiran@scalex86.org \
    --cc=ak@suse.de \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.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