All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravikiran G Thirumalai <kiran@scalex86.org>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org, discuss@x86-64.org,
	Andrew Morton <akpm@osdl.org>
Subject: [patch 1/3] x86_64: Node local pda take 2 -- early cpu_to_node
Date: Wed, 14 Dec 2005 18:33:45 -0800	[thread overview]
Message-ID: <20051215023345.GB3787@localhost.localdomain> (raw)

Here is take 2 on x86_64 node local pda allocation.

This patchset does away with the extra memory reference for non CONFIG_NUMA
case.  The early cpu_to_node helps AMD and EM64T systems which work well
with CONFIG_ACPI_NUMA.  cpu_to_node is not inited early for AMD systems
which work only with old style K8_NUMA. (Tested on EM64 NUMA and Tyan K8
dual core 4 cpu boxes)

Andi, I could not eliminate the need for a initial static pda array, since
sched_init needs the static per-cpu offset array for NR_CPUS early.  Hope
this is OK.

Thanks,
Kiran

---

Patch enables early intialization of cpu_to_node. apicid_to_node is built by reading
the SRAT table, from acpi_numa_init, and x86_cpu_to_apicid is built by parsing the ACPI
MADT table, from acpi_boot_init. We combine these two tables and setup cpu_to_node.

Early intialization helps the static per_cpu_areas in getting pages from correct node.

Tested on EM64T NUMA and Tyan K8 dual core board (with CONFIG_ACPI_NUMA + K8)

Signed-off-by: Alok N Kataria <alokk@calsoftinc.com>
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>

Index: linux-2.6.15-rc4/arch/x86_64/kernel/setup.c
===================================================================
--- linux-2.6.15-rc4.orig/arch/x86_64/kernel/setup.c	2005-12-02 16:25:19.000000000 -0800
+++ linux-2.6.15-rc4/arch/x86_64/kernel/setup.c	2005-12-12 01:49:00.000000000 -0800
@@ -669,6 +669,8 @@
 	acpi_boot_init();
 #endif
 
+	init_cpu_to_node();
+
 #ifdef CONFIG_X86_LOCAL_APIC
 	/*
 	 * get boot-time SMP configuration:
Index: linux-2.6.15-rc4/arch/x86_64/mm/srat.c
===================================================================
--- linux-2.6.15-rc4.orig/arch/x86_64/mm/srat.c	2005-12-01 17:09:51.000000000 -0800
+++ linux-2.6.15-rc4/arch/x86_64/mm/srat.c	2005-12-12 01:19:00.000000000 -0800
@@ -226,4 +226,15 @@
 	return acpi_slit->entry[index + node_to_pxm(b)];
 }
 
+/*
+ * Setup cpu_to_node using the SRAT lapcis & ACPI MADT table
+ * info.
+ */
+void __init init_cpu_to_node(void)
+{
+	int i;	
+ 	for (i = 0; i < NR_CPUS; i++)
+ 		cpu_to_node[i] = apicid_to_node[x86_cpu_to_apicid[i]];
+}
+
 EXPORT_SYMBOL(__node_distance);
Index: linux-2.6.15-rc4/include/linux/acpi.h
===================================================================
--- linux-2.6.15-rc4.orig/include/linux/acpi.h	2005-10-27 17:02:08.000000000 -0700
+++ linux-2.6.15-rc4/include/linux/acpi.h	2005-12-12 01:52:28.000000000 -0800
@@ -519,11 +519,16 @@
 
 #ifdef CONFIG_ACPI_NUMA
 int acpi_get_pxm(acpi_handle handle);
+void __init init_cpu_to_node();
 #else
 static inline int acpi_get_pxm(acpi_handle handle)
 {
 	return 0;
 }
+
+static inline void init_cpu_to_node(void)
+{
+}
 #endif
 
 extern int pnpacpi_disabled;

             reply	other threads:[~2005-12-15  2:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-15  2:33 Ravikiran G Thirumalai [this message]
2005-12-15  2:35 ` [patch 2/3] x86_64: Node local pda take 2 -- cpu_pda_prep Ravikiran G Thirumalai
2005-12-15  2:37 ` [patch 3/3] x86_64: Node local pda take 2 -- node local pda allocation Ravikiran G Thirumalai
2005-12-15  8:22   ` Eric Dumazet
2005-12-15  9:36     ` Andi Kleen
2005-12-15  9:42   ` [discuss] " Andi Kleen
2005-12-15 18:47     ` Ravikiran G Thirumalai
2005-12-16  0:19       ` Andi Kleen
2005-12-16  3:55         ` Ravikiran G Thirumalai
2005-12-15  9:44 ` [discuss] [patch 1/3] x86_64: Node local pda take 2 -- early cpu_to_node Andi Kleen
2005-12-15 19:01   ` Ravikiran G Thirumalai
2005-12-16  0:20     ` Andi Kleen
2005-12-16  8:11       ` Ravikiran G Thirumalai

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=20051215023345.GB3787@localhost.localdomain \
    --to=kiran@scalex86.org \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=discuss@x86-64.org \
    --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 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.