From: Yasuaki Ishimatsu Subject: [RFC PATCH v4 13/13] memory-hotplug : remove sysfs file of node Date: Wed, 18 Jul 2012 19:18:30 +0900 Message-ID: <50068D76.9000709@jp.fujitsu.com> References: <50068974.1070409@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit Return-path: Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:34174 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753227Ab2GRKSu (ORCPT ); Wed, 18 Jul 2012 06:18:50 -0400 In-Reply-To: <50068974.1070409@jp.fujitsu.com> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-acpi@vger.kernel.org Cc: rientjes@google.com, liuj97@gmail.com, len.brown@intel.com, benh@kernel.crashing.org, paulus@samba.org, cl@linux.com, minchan.kim@gmail.com, akpm@linux-foundation.org, kosaki.motohiro@jp.fujitsu.com, wency@cn.fujitsu.com The patch adds node_set_offline() and unregister_one_node() to remove_memory() for removing sysfs file of node. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- mm/memory_hotplug.c | 5 +++++ 1 file changed, 5 insertions(+) Index: linux-3.5-rc6/mm/memory_hotplug.c =================================================================== --- linux-3.5-rc6.orig/mm/memory_hotplug.c 2012-07-18 18:25:11.036597977 +0900 +++ linux-3.5-rc6/mm/memory_hotplug.c 2012-07-18 18:25:54.860050109 +0900 @@ -1048,6 +1048,11 @@ int __ref remove_memory(int nid, u64 sta /* remove memmap entry */ firmware_map_remove(start, start + size, "System RAM"); + if (!node_present_pages(nid)) { + node_set_offline(nid); + unregister_one_node(nid); + } + __remove_pages(start >> PAGE_SHIFT, size >> PAGE_SHIFT); out: unlock_memory_hotplug();