* [RFC] Patch [2/4] x86_64 sparsmem add - implement arch_find_node in memory_hotplug code.
@ 2006-06-24 2:05 keith mannthey
2006-06-24 7:24 ` KAMEZAWA Hiroyuki
0 siblings, 1 reply; 2+ messages in thread
From: keith mannthey @ 2006-06-24 2:05 UTC (permalink / raw)
To: lhms-devel; +Cc: linux-mm, dave hansen, kame
[-- 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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC] Patch [2/4] x86_64 sparsmem add - implement arch_find_node in memory_hotplug code.
2006-06-24 2:05 [RFC] Patch [2/4] x86_64 sparsmem add - implement arch_find_node in memory_hotplug code keith mannthey
@ 2006-06-24 7:24 ` KAMEZAWA Hiroyuki
0 siblings, 0 replies; 2+ messages in thread
From: KAMEZAWA Hiroyuki @ 2006-06-24 7:24 UTC (permalink / raw)
To: kmannth; +Cc: lhms-devel, linux-mm, haveblue
Hi,
On Fri, 23 Jun 2006 19:05:48 -0700
keith mannthey <kmannth@us.ibm.com> wrote:
> I intend to implement an arch_find_node for i386 in the near
> future.
>
ya, welcome :)
>
> Signed-off-by: Keith Mannthey <kmannth@us.ibm.com>
>
+config ARCH_FIND_NODE
+ def_bool y
+ depends on MEMORY_HOTPLUG
+
maybe
--
depends on MEMORY_HOTPLUG && NUMA
--
is better.
-Kame
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-24 7:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-24 2:05 [RFC] Patch [2/4] x86_64 sparsmem add - implement arch_find_node in memory_hotplug code keith mannthey
2006-06-24 7:24 ` KAMEZAWA Hiroyuki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox