public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Mannthey <kmannth@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, discuss@x86-64.org,
	Keith Mannthey <kmannth@us.ibm.com>,
	ak@suse.de, lhms-devel@lists.sourceforge.net,
	kamezawa.hiroyu@jp.fujitsu.com
Subject: [PATCH 9/10] hot-add-mem x86_64: use CONFIG_MEMORY_HOTPLUG_RESERVE
Date: Fri, 4 Aug 2006 07:14:39 -0600	[thread overview]
Message-ID: <20060804131439.21401.62864.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20060804131351.21401.4877.sendpatchset@localhost.localdomain>

From: Keith Mannthey <kmannth@us.ibm.com>

  The api for hot-add memory already has a construct for finding nodes based on
an address, memory_add_physaddr_to_nid.  This patch allows the fucntion to do 
something besides return 0.  It uses the nodes_add infomation to lookup to node 
info for a hot add event. 

Signed-off-by: Keith Mannthey<kmannth@us.ibm.com>
---
 init.c |   20 +++++++-------------
 srat.c |   13 ++++++++++++-
 2 files changed, 19 insertions(+), 14 deletions(-)

diff -urN linux-2.6.17/arch/x86_64/mm/init.c current/arch/x86_64/mm/init.c
--- linux-2.6.17/arch/x86_64/mm/init.c	2006-08-04 01:30:39.000000000 -0400
+++ current/arch/x86_64/mm/init.c	2006-08-04 01:24:04.000000000 -0400
@@ -517,19 +517,6 @@
 
 #ifdef CONFIG_MEMORY_HOTPLUG
 /*
- * XXX: memory_add_physaddr_to_nid() is to find node id from physical address
- *	via probe interface of sysfs. If acpi notifies hot-add event, then it
- *	can tell node id by searching dsdt. But, probe interface doesn't have
- *	node id. So, return 0 as node id at this time.
- */
-#ifdef CONFIG_NUMA
-int memory_add_physaddr_to_nid(u64 start)
-{
-	return 0;
-}
-#endif
-
-/*
  * Memory is added always to NORMAL zone. This means you will never get
  * additional DMA/DMA32 memory.
  */
@@ -560,6 +547,13 @@
 }
 EXPORT_SYMBOL_GPL(remove_memory);
 
+#ifndef CONFIG_ACPI_NUMA
+int memory_add_physaddr_to_nid(u64 start)
+{
+	return 0;
+}
+#endif 
+
 #else /* CONFIG_MEMORY_HOTPLUG */
 /*
  * Memory Hotadd without sparsemem. The mem_maps have been allocated in advance,
diff -urN linux-2.6.17/arch/x86_64/mm/srat.c current/arch/x86_64/mm/srat.c
--- linux-2.6.17/arch/x86_64/mm/srat.c	2006-08-04 01:31:44.000000000 -0400
+++ current/arch/x86_64/mm/srat.c	2006-08-04 01:24:04.000000000 -0400
@@ -25,7 +25,7 @@
 
 static nodemask_t nodes_parsed __initdata;
 static struct bootnode nodes[MAX_NUMNODES] __initdata;
-static struct bootnode nodes_add[MAX_NUMNODES] __initdata;
+static struct bootnode nodes_add[MAX_NUMNODES];
 static int found_add_area __initdata;
 int hotadd_percent __initdata = 0;
 
@@ -457,3 +457,14 @@
 }
 
 EXPORT_SYMBOL(__node_distance);
+
+int memory_add_physaddr_to_nid(u64 start)
+{
+	int i, ret = 0;
+	
+	for_each_node(i) 
+		if (nodes_add[i].start <= start && nodes_add[i].end > start)
+			ret = i;
+
+	return ret;
+}

  parent reply	other threads:[~2006-08-04 13:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-04 13:13 [PATCH 1/10] hot-add-mem x86_64: acpi motherboard fix Keith Mannthey
2006-08-04 13:13 ` [PATCH 2/10] hot-add-mem x86_64: fixup externs Keith Mannthey
2006-08-04 13:14 ` [PATCH 3/10] hot-add-mem x86_64: Kconfig changes Keith Mannthey
2006-08-04 13:14 ` [PATCH 4/10] hot-add-mem x86_64: Enable SPARSEMEM in srat.c Keith Mannthey
2006-08-04 15:17   ` [Lhms-devel] " Mika Penttilä
2006-08-04 19:36     ` keith mannthey
2006-08-04 17:42   ` Dave Hansen
2006-08-04 13:14 ` [PATCH 5/10] hot-add-mem x86_64: memory_add_physaddr_to_nid enable Keith Mannthey
2006-08-04 13:14 ` [PATCH 7/10] hot-add-mem x86_64: x86_64 kernel mapping fix Keith Mannthey
2006-08-04 13:14 ` [PATCH 8/10] hot-add-mem x86_64: use CONFIG_MEMORY_HOTPLUG_SPARSE Keith Mannthey
2006-08-04 13:14 ` Keith Mannthey [this message]
2006-08-07 17:41   ` [PATCH 9/10] hot-add-mem x86_64: use CONFIG_MEMORY_HOTPLUG_RESERVE keith mannthey
2006-08-04 13:14 ` [PATCH 10/10] hot-add-mem x86_64: valid add range check Keith Mannthey
2006-08-05  5:39 ` [PATCH 1/10] hot-add-mem x86_64: acpi motherboard fix KAMEZAWA Hiroyuki
2006-08-05  5:51 ` KAMEZAWA Hiroyuki
2006-08-07 18:39   ` keith mannthey
2006-08-08  0:31     ` [Lhms-devel] " KAMEZAWA Hiroyuki
2006-08-08  0:56       ` keith mannthey
2006-08-08  2:08         ` KAMEZAWA Hiroyuki
2006-08-08  2:15           ` keith mannthey

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=20060804131439.21401.62864.sendpatchset@localhost.localdomain \
    --to=kmannth@us.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=discuss@x86-64.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --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