[PATCH](memory hotplug) Fix acpi_get_node() when _PXM is not defined.

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

 



Hello.

This patch is to avoid returning negative value for node id if _PXM is not
defined in ACPI's DSDT. There are 2 possible cases.

  1) The hot-add code is executed with NUMA kernel on NON-NUMA box.
  2) Firmware expects only SRAT table's information to find pxm,
     and it doesn't expect DSDT.

If -1 is returned for node id, kernel will touch no-pgdat address
when hot-add is executed.

To fix case 2) exactly, kernel should search memory block information
which cames from SRAT at boottime. But, it will be arch dependent code
and it is not written for i386 and ia64 yet. And it will be post later.
So, at least, kernel panic should be avoided on 2.6.18 by this patch.

This patch is for 2.6.18-rc3. And I tested this patch on my Tiger4 with
hot-add emulation.

Please apply.

Signed-off-by: Yasunori Goto <y-goto@xxxxxxxxxxxxxx>

 drivers/acpi/numa.c |    4 ++++
 1 files changed, 4 insertions(+)

Index: hotmemtest1/drivers/acpi/numa.c
===================================================================
--- hotmemtest1.orig/drivers/acpi/numa.c	2006-08-01 20:13:24.000000000 +0900
+++ hotmemtest1/drivers/acpi/numa.c	2006-08-01 20:14:27.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 = first_online_node;
+
 	return node;
 }
 EXPORT_SYMBOL(acpi_get_node);

-- 
Yasunori Goto 


-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux