From patchwork Tue Jul 3 06:06:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yasuaki Ishimatsu X-Patchwork-Id: 1149211 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 C2133DFF72 for ; Tue, 3 Jul 2012 06:06:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118Ab2GCGGV (ORCPT ); Tue, 3 Jul 2012 02:06:21 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:37390 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753515Ab2GCGGV (ORCPT ); Tue, 3 Jul 2012 02:06:21 -0400 Received: from m4.gw.fujitsu.co.jp (unknown [10.0.50.74]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 55A2A3EE0CD; Tue, 3 Jul 2012 15:06:20 +0900 (JST) Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 3D38D45DE4D; Tue, 3 Jul 2012 15:06:20 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 13BB945DE4F; Tue, 3 Jul 2012 15:06:20 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 05DDA1DB803B; Tue, 3 Jul 2012 15:06:20 +0900 (JST) Received: from g01jpexchyt05.g01.fujitsu.local (g01jpexchyt05.g01.fujitsu.local [10.128.194.44]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id AFA971DB8040; Tue, 3 Jul 2012 15:06:19 +0900 (JST) Received: from [127.0.0.1] (10.124.101.33) by g01jpexchyt05.g01.fujitsu.local (10.128.194.44) with Microsoft SMTP Server id 14.2.309.2; Tue, 3 Jul 2012 15:06:17 +0900 X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Message-ID: <4FF28BCE.7000904@jp.fujitsu.com> Date: Tue, 3 Jul 2012 15:06:06 +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 v2 13/13] memory-hotplug : remove sysfs file of node References: <4FF287C3.4030901@jp.fujitsu.com> In-Reply-To: <4FF287C3.4030901@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 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;