From patchwork Mon Jul 9 10:35:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yasuaki Ishimatsu X-Patchwork-Id: 1172281 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AB19240B18 for ; Mon, 9 Jul 2012 10:43:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753068Ab2GIKgT (ORCPT ); Mon, 9 Jul 2012 06:36:19 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:37142 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753000Ab2GIKgS (ORCPT ); Mon, 9 Jul 2012 06:36:18 -0400 Received: from m1.gw.fujitsu.co.jp (unknown [10.0.50.71]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 51D423EE0C3; Mon, 9 Jul 2012 19:36:18 +0900 (JST) Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 2E32A45DE61; Mon, 9 Jul 2012 19:36:18 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 08CF145DE5C; Mon, 9 Jul 2012 19:36:18 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id E67BA1DB8055; Mon, 9 Jul 2012 19:36:17 +0900 (JST) Received: from g01jpexchyt07.g01.fujitsu.local (g01jpexchyt07.g01.fujitsu.local [10.128.194.46]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 97C9D1DB8050; Mon, 9 Jul 2012 19:36:17 +0900 (JST) Received: from [127.0.0.1] (10.124.101.33) by g01jpexchyt07.g01.fujitsu.local (10.128.194.46) with Microsoft SMTP Server id 14.2.309.2; Mon, 9 Jul 2012 19:36:12 +0900 X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Message-ID: <4FFAB406.1020002@jp.fujitsu.com> Date: Mon, 9 Jul 2012 19:35:50 +0900 From: Yasuaki Ishimatsu User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: , , , CC: , , , , , , , , , Subject: [RFC PATCH v3 13/13] memory-hotplug : remove sysfs file of node References: <4FFAB0A2.8070304@jp.fujitsu.com> In-Reply-To: <4FFAB0A2.8070304@jp.fujitsu.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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(+) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-3.5-rc4/mm/memory_hotplug.c =================================================================== --- linux-3.5-rc4.orig/mm/memory_hotplug.c 2012-07-03 14:22:21.012982694 +0900 +++ linux-3.5-rc4/mm/memory_hotplug.c 2012-07-03 14:22:25.405925554 +0900 @@ -702,6 +702,11 @@ int remove_memory(int nid, u64 start, u6 /* remove memmap entry */ firmware_map_remove(start, start + size - 1, "System RAM"); + if (!node_present_pages(nid)) { + node_set_offline(nid); + unregister_one_node(nid); + } + __remove_pages(start >> PAGE_SHIFT, size >> PAGE_SHIFT); unlock_memory_hotplug(); return 0;