linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: keith mannthey <kmannth@us.ibm.com>
To: lhms-devel <lhms-devel@lists.sourceforge.net>
Cc: linux-mm <linux-mm@kvack.org>, dave hansen <haveblue@us.ibm.com>,
	kame <kamezawa.hiroyu@jp.fujitsu.com>
Subject: [RFC] Patch [2/4] x86_64 sparsmem add - implement arch_find_node in memory_hotplug code.
Date: Fri, 23 Jun 2006 19:05:48 -0700	[thread overview]
Message-ID: <1151114748.7094.51.camel@keithlap> (raw)

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

  The current MEMORY_HOTPLUG code expects that the ACPI layer (for the
Intel space) will pass along the _PXM data (this is node locality data).
This is an optional field for the acpi namespace and one which Linux
should not require for hot-add memory. 

  This patch creates uses the arch_find_node function and wedges it into
the generic add_memory function.  When the acpi can't resolve the _PXM
data (as in my hardware event) it returns -1.  I build a check into
add_memory that looks for invalid data passes id < 0 and calls
arch_find_node.  
  
  I intend to implement an arch_find_node for i386 in the near
future.     


Signed-off-by:  Keith Mannthey <kmannth@us.ibm.com>

[-- Attachment #2: patch-2.6.17-mm1-use_arch_find_node --]
[-- Type: text/x-patch, Size: 1712 bytes --]

diff -urN linux-2.6.17-mm1-orig/arch/x86_64/Kconfig linux-2.6.17-mm1/arch/x86_64/Kconfig
--- linux-2.6.17-mm1-orig/arch/x86_64/Kconfig	2006-06-23 16:12:00.000000000 -0400
+++ linux-2.6.17-mm1/arch/x86_64/Kconfig	2006-06-23 20:35:03.000000000 -0400
@@ -335,6 +335,10 @@
 	def_bool y
 	depends on MEMORY_HOTPLUG
 
+config ARCH_FIND_NODE
+	def_bool y
+	depends on MEMORY_HOTPLUG
+
 config ARCH_FLATMEM_ENABLE
 	def_bool y
 	depends on !NUMA
diff -urN linux-2.6.17-mm1-orig/include/linux/memory_hotplug.h linux-2.6.17-mm1/include/linux/memory_hotplug.h
--- linux-2.6.17-mm1-orig/include/linux/memory_hotplug.h	2006-06-23 16:12:09.000000000 -0400
+++ linux-2.6.17-mm1/include/linux/memory_hotplug.h	2006-06-23 20:35:03.000000000 -0400
@@ -132,7 +132,11 @@
 }
 #endif /* CONFIG_NUMA */
 #endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */
-
+#ifdef CONFIG_ARCH_FIND_NODE
+	extern int arch_find_node(unsigned long, unsigned long);
+#else
+	static inline int arch_find_node(unsigned long a,  unsigned long b) {return 0;}
+#endif
 #else /* ! CONFIG_MEMORY_HOTPLUG */
 /*
  * Stub functions for when hotplug is off
diff -urN linux-2.6.17-mm1-orig/mm/memory_hotplug.c linux-2.6.17-mm1/mm/memory_hotplug.c
--- linux-2.6.17-mm1-orig/mm/memory_hotplug.c	2006-06-23 16:12:10.000000000 -0400
+++ linux-2.6.17-mm1/mm/memory_hotplug.c	2006-06-23 20:35:03.000000000 -0400
@@ -234,12 +234,17 @@
 
 
 
-int add_memory(int nid, u64 start, u64 size)
+int add_memory(int node, u64 start, u64 size)
 {
 	pg_data_t *pgdat = NULL;
 	int new_pgdat = 0;
-	int ret;
+	int ret,nid;
 
+	if (node < 0) 
+		nid = arch_find_node(start,size);
+	else
+		nid = node;
+	
 	if (!node_online(nid)) {
 		pgdat = hotadd_new_pgdat(nid, start);
 		if (!pgdat)

             reply	other threads:[~2006-06-24  2:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-24  2:05 keith mannthey [this message]
2006-06-24  7:24 ` KAMEZAWA Hiroyuki

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=1151114748.7094.51.camel@keithlap \
    --to=kmannth@us.ibm.com \
    --cc=haveblue@us.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-mm@kvack.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