Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932105AbWBFNia (ORCPT ); Mon, 6 Feb 2006 08:38:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932092AbWBFNiI (ORCPT ); Mon, 6 Feb 2006 08:38:08 -0500 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:50413 "EHLO fgwmail5.fujitsu.co.jp") by vger.kernel.org with ESMTP id S932101AbWBFNiF (ORCPT ); Mon, 6 Feb 2006 08:38:05 -0500 Date: Mon, 06 Feb 2006 22:37:31 +0900 From: Yasunori Goto To: "Tolentino, Matthew E" , "Brown, Len" , "Luck, Tony" , naveen.b.s@intel.com, Andi Kleen Subject: [RFC:PATCH(003/003)] Memory add to onlined node.(For x86_64) Cc: Linux Kernel ML , ACPI-ML , linux-ia64@vger.kernel.org, x86-64 Discuss X-Mailer-Plugin: BkASPil for Becky!2 Ver.2.062 Message-Id: <20060206222347.060B.Y-GOTO@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.24.02 [ja] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1596 Lines: 52 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 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 #include #include +#include #include #include @@ -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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/