* [RFC:PATCH(003/003)] Memory add to onlined node.(For x86_64)
@ 2006-02-06 13:37 Yasunori Goto
2006-02-09 7:06 ` [RFC:PATCH(003/003)] Memory add to onlined node. (ver. 2) (For x86_64) Yasunori Goto
0 siblings, 1 reply; 2+ messages in thread
From: Yasunori Goto @ 2006-02-06 13:37 UTC (permalink / raw)
To: Tolentino, Matthew E, Brown, Len, Luck, Tony, naveen.b.s,
Andi Kleen
Cc: Linux Kernel ML, ACPI-ML, linux-ia64, x86-64 Discuss
This is for x86_64 to add memory which belongs onlined node.
This patch is just confirmed compile completion.
If there is no objection, I would like to test this.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Index: linux-2.6.15/arch/x86_64/mm/init.c
=================================--- linux-2.6.15.orig/arch/x86_64/mm/init.c 2006-02-06 16:47:41.000000000 +0900
+++ linux-2.6.15/arch/x86_64/mm/init.c 2006-02-06 18:31:52.000000000 +0900
@@ -26,6 +26,7 @@
#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/memory_hotplug.h>
+#include <linux/acpi.h>
#include <asm/processor.h>
#include <asm/system.h>
@@ -494,11 +495,20 @@
int add_memory(u64 start, u64 size)
{
- struct pglist_data *pgdat = NODE_DATA(0);
- struct zone *zone = pgdat->node_zones + MAX_NR_ZONES-2;
+ struct pglist_data *pgdat;
+ struct zone *zone;
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
- int ret;
+ int ret, node;
+
+ node = acpi_paddr_to_node(start, size);
+ if (node >= 0 && node_online(node))
+ pgdat = NODE_DATA(node);
+ else
+ /* New node's memory will be added to Node 0 temporally. */
+ pgdat = NODE_DATA(0);
+
+ zone = pgdat->node_zones + MAX_NR_ZONES - 2;
ret = __add_pages(zone, start_pfn, nr_pages);
if (ret)
--
Yasunori Goto
^ permalink raw reply [flat|nested] 2+ messages in thread* [RFC:PATCH(003/003)] Memory add to onlined node. (ver. 2) (For x86_64)
2006-02-06 13:37 [RFC:PATCH(003/003)] Memory add to onlined node.(For x86_64) Yasunori Goto
@ 2006-02-09 7:06 ` Yasunori Goto
0 siblings, 0 replies; 2+ messages in thread
From: Yasunori Goto @ 2006-02-09 7:06 UTC (permalink / raw)
To: Andi Kleen, Tolentino, Matthew E, Brown, Len, Luck, Tony,
naveen.b.s, Bjorn Helgaas
Cc: Linux Kernel ML, ACPI-ML, linux-ia64, x86-64 Discuss,
Linux Hotplug Memory Support
This is for x86_64 to add memory which belongs onlined node.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Index: node_simple3/arch/x86_64/mm/init.c
=================================--- node_simple3.orig/arch/x86_64/mm/init.c 2006-02-09 12:01:47.000000000 +0900
+++ node_simple3/arch/x86_64/mm/init.c 2006-02-09 14:09:11.000000000 +0900
@@ -26,6 +26,7 @@
#include <linux/dma-mapping.h>
#include <linux/module.h>
#include <linux/memory_hotplug.h>
+#include <linux/acpi.h>
#include <asm/processor.h>
#include <asm/system.h>
@@ -494,11 +495,20 @@ void online_page(struct page *page)
int add_memory(u64 start, u64 size)
{
- struct pglist_data *pgdat = NODE_DATA(0);
- struct zone *zone = pgdat->node_zones + MAX_NR_ZONES-2;
+ struct pglist_data *pgdat;
+ struct zone *zone;
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
- int ret;
+ int ret, node;
+
+ node = acpi_paddr_to_node(start, size);
+ if (node >= 0 && node_online(node))
+ pgdat = NODE_DATA(node);
+ else
+ /* New node's memory will be added to Node 0 temporally. */
+ pgdat = NODE_DATA(0);
+
+ zone = pgdat->node_zones + MAX_NR_ZONES - 2;
ret = __add_pages(zone, start_pfn, nr_pages);
if (ret)
--
Yasunori Goto
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-02-09 7:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-06 13:37 [RFC:PATCH(003/003)] Memory add to onlined node.(For x86_64) Yasunori Goto
2006-02-09 7:06 ` [RFC:PATCH(003/003)] Memory add to onlined node. (ver. 2) (For x86_64) Yasunori Goto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox