From patchwork Wed Oct 31 11:23:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Congyang X-Patchwork-Id: 1678781 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 72D3DDF264 for ; Wed, 31 Oct 2012 12:00:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935478Ab2JaMAH (ORCPT ); Wed, 31 Oct 2012 08:00:07 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:7755 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S935473Ab2JaMAG (ORCPT ); Wed, 31 Oct 2012 08:00:06 -0400 X-IronPort-AV: E=Sophos;i="4.80,687,1344182400"; d="scan'208";a="6108970" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 31 Oct 2012 19:58:29 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id q9VBHOou026739; Wed, 31 Oct 2012 19:17:28 +0800 Received: from ghost.fnst.cn.fujitsu.com ([10.167.225.226]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012103119164470-879575 ; Wed, 31 Oct 2012 19:16:44 +0800 From: Wen Congyang To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Cc: Jiang Liu , Len Brown , Andrew Morton , KOSAKI Motohiro , Yasuaki Ishimatsu , rjw@sisk.pl, Lai Jiangshan , Wen Congyang , David Rientjes , Benjamin Herrenschmidt , Paul Mackerras , Christoph Lameter , Minchan Kim , Dave Hansen , Mel Gorman Subject: [Patch v4 2/8] memory-hotplug: auto offline page_cgroup when onlining memory block failed Date: Wed, 31 Oct 2012 19:23:08 +0800 Message-Id: <1351682594-17347-3-git-send-email-wency@cn.fujitsu.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1351682594-17347-1-git-send-email-wency@cn.fujitsu.com> References: <1351682594-17347-1-git-send-email-wency@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/10/31 19:16:44, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/10/31 19:16:54, Serialize complete at 2012/10/31 19:16:54 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org When a memory block is onlined, we will try allocate memory on that node to store page_cgroup. If onlining the memory block failed, we don't offline the page cgroup, and we have no chance to offline this page cgroup unless the memory block is onlined successfully again. It will cause that we can't hot-remove the memory device on that node, because some memory is used to store page cgroup. If onlining the memory block is failed, there is no need to stort page cgroup for this memory. So auto offline page_cgroup when onlining memory block failed. Signed-off-by: Wen Congyang Cc: David Rientjes Cc: Jiang Liu Cc: Len Brown Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Christoph Lameter Cc: Minchan Kim Acked-by: KOSAKI Motohiro Cc: Yasuaki Ishimatsu Cc: Dave Hansen Cc: Mel Gorman Signed-off-by: Andrew Morton --- mm/page_cgroup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 5ddad0c..44db00e 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -251,6 +251,9 @@ static int __meminit page_cgroup_callback(struct notifier_block *self, mn->nr_pages, mn->status_change_nid); break; case MEM_CANCEL_ONLINE: + offline_page_cgroup(mn->start_pfn, + mn->nr_pages, mn->status_change_nid); + break; case MEM_GOING_OFFLINE: break; case MEM_ONLINE: