public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCH: 003/010] Memory hotplug for new nodes with pgdat allocation. (pgdat alloc caller for ia6
@ 2006-02-10 14:20 Yasunori Goto
  0 siblings, 0 replies; only message in thread
From: Yasunori Goto @ 2006-02-10 14:20 UTC (permalink / raw)
  To: Luck, Tony, Andi Kleen, Tolentino, Matthew E
  Cc: linux-ia64, Linux Kernel ML, x86-64 Discuss,
	Linux Hotplug Memory Support

This is caller of pgdat allocation for ia64.
If new memory belongs to new nodes, pgdat is allocated...

Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>

Index: pgdat2/arch/ia64/mm/init.c
=================================--- pgdat2.orig/arch/ia64/mm/init.c	2006-02-10 17:03:43.000000000 +0900
+++ pgdat2/arch/ia64/mm/init.c	2006-02-10 17:29:30.000000000 +0900
@@ -20,6 +20,7 @@
 #include <linux/swap.h>
 #include <linux/proc_fs.h>
 #include <linux/bitops.h>
+#include <linux/acpi.h>
 
 #include <asm/a.out.h>
 #include <asm/dma.h>
@@ -652,16 +653,32 @@ int add_memory(u64 start, u64 size)
 	struct zone *zone;
 	unsigned long start_pfn = start >> PAGE_SHIFT;
 	unsigned long nr_pages = size >> PAGE_SHIFT;
-	int ret;
+	int ret, node, new_pgdat = 0;
 
-	pgdat = NODE_DATA(0);
+	node = acpi_paddr_to_node(start, size);
+
+	if (node < 0)
+	        node = 0; /* pxm is undefined in DSDT.
+			     This might be non NUMA case */
+
+	if (!node_online(node)){
+		ret = new_pgdat_init(node, start_pfn, nr_pages);
+		if (ret)
+			return ret;
+
+		new_pgdat = 1;
+	}
+	pgdat = NODE_DATA(node);
 
 	zone = pgdat->node_zones + ZONE_NORMAL;
 	ret = __add_pages(zone, start_pfn, nr_pages);
 
-	if (ret)
+	if (ret){
 		printk("%s: Problem encountered in __add_pages() as ret=%d\n",
 		       __FUNCTION__,  ret);
+		if (new_pgdat)
+			release_pgdat(pgdat);
+	}
 
 	return ret;
 }

-- 
Yasunori Goto 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-10 14:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-10 14:20 [RFC/PATCH: 003/010] Memory hotplug for new nodes with pgdat allocation. (pgdat alloc caller for ia6 Yasunori Goto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox