From: keith mannthey <kmannth@us.ibm.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: lhms-devel <lhms-devel@lists.sourceforge.net>,
Andi Kleen <ak@suse.de>, andrew <akpm@osdl.org>,
dave hansen <haveblue@us.ibm.com>,
kame <kamezawa.hiroyu@jp.fujitsu.com>,
discuss <discuss@x86-64.org>, konrad <darnok@us.ibm.com>
Subject: [Patch] 2/5 in support of hot-add memory x86_64 create arch_find_node
Date: Fri, 28 Jul 2006 19:52:24 -0700 [thread overview]
Message-ID: <1154141545.5874.146.camel@keithlap> (raw)
[-- Attachment #1: Type: text/plain, Size: 585 bytes --]
With the advent of the new ACPI hot-plug memory driver and mechanism
is needed to deal with ACPI add memory events that do not contain the
pxm (node) information. I do not believe that the add-event is required
to contain this information so I create a arch_find_node generic layer
used in the generic add_memory function.
If add_memory is called with node < 0 arch_find_node is invoked to
fine the correct node to add the memory. This created the generic
construct of arch_find_node.
This was built against 2.6.18-rc2.
Signed-off-by: Keith Mannthey <kmannth@us.ibm.com>
[-- Attachment #2: patch-2.6.18-rc2-arch_find_node_generic --]
[-- Type: text/x-patch, Size: 1158 bytes --]
diff -urN orig/include/linux/memory_hotplug.h work/include/linux/memory_hotplug.h
--- orig/include/linux/memory_hotplug.h 2006-07-28 13:57:37.000000000 -0400
+++ work/include/linux/memory_hotplug.h 2006-07-26 20:18:35.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 orig/mm/memory_hotplug.c work/mm/memory_hotplug.c
--- orig/mm/memory_hotplug.c 2006-07-28 13:57:38.000000000 -0400
+++ work/mm/memory_hotplug.c 2006-07-26 20:18:35.000000000 -0400
@@ -233,12 +233,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)
next reply other threads:[~2006-07-29 2:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-29 2:52 keith mannthey [this message]
2006-07-29 16:25 ` [discuss] [Patch] 2/5 in support of hot-add memory x86_64 create arch_find_node Andi Kleen
2006-07-29 19:38 ` keith mannthey
2006-07-30 2:17 ` KAMEZAWA Hiroyuki
2006-07-31 7:31 ` [Lhms-devel] " Yasunori Goto
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=1154141545.5874.146.camel@keithlap \
--to=kmannth@us.ibm.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=darnok@us.ibm.com \
--cc=discuss@x86-64.org \
--cc=haveblue@us.ibm.com \
--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