From patchwork Wed Jul 18 10:18:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yasuaki Ishimatsu X-Patchwork-Id: 1209901 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 95473DFFFD for ; Wed, 18 Jul 2012 10:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752111Ab2GRKSu (ORCPT ); Wed, 18 Jul 2012 06:18:50 -0400 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 Received: from m3.gw.fujitsu.co.jp (unknown [10.0.50.73]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 37AB93EE0C0; Wed, 18 Jul 2012 19:18:49 +0900 (JST) Received: from smail (m3 [127.0.0.1]) by outgoing.m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 1BF0B45DEB2; Wed, 18 Jul 2012 19:18:49 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (s3.gw.fujitsu.co.jp [10.0.50.93]) by m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 0190945DE9E; Wed, 18 Jul 2012 19:18:49 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id E8D9E1DB803E; Wed, 18 Jul 2012 19:18:48 +0900 (JST) Received: from g01jpexchyt07.g01.fujitsu.local (g01jpexchyt07.g01.fujitsu.local [10.128.194.46]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 9692D1DB803B; Wed, 18 Jul 2012 19:18:48 +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; Wed, 18 Jul 2012 19:18:44 +0900 X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Message-ID: <50068D76.9000709@jp.fujitsu.com> Date: Wed, 18 Jul 2012 19:18:30 +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 v4 13/13] memory-hotplug : remove sysfs file of node References: <50068974.1070409@jp.fujitsu.com> In-Reply-To: <50068974.1070409@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-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();