* [Patch] 2/5 in support of hot-add memory x86_64 create arch_find_node
@ 2006-07-29 2:52 keith mannthey
2006-07-29 16:25 ` [discuss] " Andi Kleen
0 siblings, 1 reply; 5+ messages in thread
From: keith mannthey @ 2006-07-29 2:52 UTC (permalink / raw)
To: lkml; +Cc: lhms-devel, Andi Kleen, andrew, dave hansen, kame, discuss,
konrad
[-- 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)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [discuss] [Patch] 2/5 in support of hot-add memory x86_64 create arch_find_node
2006-07-29 2:52 [Patch] 2/5 in support of hot-add memory x86_64 create arch_find_node keith mannthey
@ 2006-07-29 16:25 ` Andi Kleen
2006-07-29 19:38 ` keith mannthey
2006-07-30 2:17 ` KAMEZAWA Hiroyuki
0 siblings, 2 replies; 5+ messages in thread
From: Andi Kleen @ 2006-07-29 16:25 UTC (permalink / raw)
To: discuss, kmannth; +Cc: lkml, lhms-devel, andrew, dave hansen, kame, konrad
On Saturday 29 July 2006 04:52, keith mannthey wrote:
> 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.
It would be cleaner to always call add_memory from architecture specific
code instead of such ugly hooks
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [discuss] [Patch] 2/5 in support of hot-add memory x86_64 create arch_find_node
2006-07-29 16:25 ` [discuss] " Andi Kleen
@ 2006-07-29 19:38 ` keith mannthey
2006-07-30 2:17 ` KAMEZAWA Hiroyuki
1 sibling, 0 replies; 5+ messages in thread
From: keith mannthey @ 2006-07-29 19:38 UTC (permalink / raw)
To: Andi Kleen; +Cc: discuss, lkml, lhms-devel, andrew, dave hansen, kame, konrad
On Sat, 2006-07-29 at 18:25 +0200, Andi Kleen wrote:
> On Saturday 29 July 2006 04:52, keith mannthey wrote:
> > 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.
>
> It would be cleaner to always call add_memory from architecture specific
> code instead of such ugly hooks
Since 2.6.18 it goes
acpi (generic calling add_memory)
add_memory (generic)
arch_add_memory (x86_64)
__add_pages (generic)
The generic add_memory call is good as it does the dynamic pgdat
allocation for new nodes. The generic add_memory call need the correct
node infomation.
Do you think we should do
acpi (generic calling add_memory)
arch_pre_add_memory? (x86_64)
add_memory (generic)
arch_add_memory (x86_64)
__add_pages (generic)
?
It would just create a function hook.
Thanks,
Keith
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [discuss] [Patch] 2/5 in support of hot-add memory x86_64 create arch_find_node
2006-07-29 16:25 ` [discuss] " 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
1 sibling, 1 reply; 5+ messages in thread
From: KAMEZAWA Hiroyuki @ 2006-07-30 2:17 UTC (permalink / raw)
To: Andi Kleen
Cc: discuss, kmannth, linux-kernel, lhms-devel, akpm, haveblue,
darnok
On Sat, 29 Jul 2006 18:25:15 +0200
Andi Kleen <ak@suse.de> wrote:
> On Saturday 29 July 2006 04:52, keith mannthey wrote:
> > 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.
>
> It would be cleaner to always call add_memory from architecture specific
> code instead of such ugly hooks
>
Hi, Keith
I don't like insert such a check (nid < 0) in add_memory(), either.
Could you add it before calling add_memory() ?
(for example, find_pxm parh in acpi's add memory code.)
-Kame
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Lhms-devel] [discuss] [Patch] 2/5 in support of hot-add memory x86_64 create arch_find_node
2006-07-30 2:17 ` KAMEZAWA Hiroyuki
@ 2006-07-31 7:31 ` Yasunori Goto
0 siblings, 0 replies; 5+ messages in thread
From: Yasunori Goto @ 2006-07-31 7:31 UTC (permalink / raw)
To: kmannth
Cc: Andi Kleen, akpm, discuss, haveblue, linux-kernel, darnok,
lhms-devel, KAMEZAWA Hiroyuki
> On Sat, 29 Jul 2006 18:25:15 +0200
> Andi Kleen <ak@suse.de> wrote:
>
> > On Saturday 29 July 2006 04:52, keith mannthey wrote:
> > > 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.
> >
> > It would be cleaner to always call add_memory from architecture specific
> > code instead of such ugly hooks
> >
> Hi, Keith
>
> I don't like insert such a check (nid < 0) in add_memory(), either.
> Could you add it before calling add_memory() ?
> (for example, find_pxm parh in acpi's add memory code.)
Agree.
I think that arch_find_node() should be called in acpi_get_node().
For the time being, I would like to post folloing patch for 2.6.18
to fix returning -1 if _PXM is not defined.
Because, not only your case, but also there might be a case that
hot add code will be executed with NUMA kernel on NON-NUMA box.
Then, arch_find_node() should be add before this line.
Thanks.
-----
drivers/acpi/numa.c | 4 ++++
1 files changed, 4 insertions(+)
Index: pxm_find1/drivers/acpi/numa.c
===================================================================
--- pxm_find1.orig/drivers/acpi/numa.c 2006-07-31 14:59:48.000000000 +0900
+++ pxm_find1/drivers/acpi/numa.c 2006-07-31 15:11:06.000000000 +0900
@@ -263,6 +263,10 @@ int acpi_get_node(acpi_handle *handle)
if (pxm >= 0)
node = acpi_map_pxm_to_node(pxm);
+ /* _PXM might not be defined by firmware. */
+ if (node < 0)
+ node = 0;
+
return node;
}
EXPORT_SYMBOL(acpi_get_node);
--
Yasunori Goto
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-07-31 7:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-29 2:52 [Patch] 2/5 in support of hot-add memory x86_64 create arch_find_node keith mannthey
2006-07-29 16:25 ` [discuss] " 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox