Re: [Lhms-devel] [discuss] [Patch] 2/5 in support of hot-add memory x86_64 create arch_find_node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Sat, 29 Jul 2006 18:25:15 +0200
> Andi Kleen <[email protected]> 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 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux