From patchwork Thu Nov 1 02:55:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Congyang X-Patchwork-Id: 1683041 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 3599F3FDDA for ; Thu, 1 Nov 2012 02:49:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756787Ab2KACtT (ORCPT ); Wed, 31 Oct 2012 22:49:19 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:6642 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1755019Ab2KACtS (ORCPT ); Wed, 31 Oct 2012 22:49:18 -0400 X-IronPort-AV: E=Sophos;i="4.80,691,1344182400"; d="scan'208";a="6112445" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 01 Nov 2012 10:47:41 +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 qA12nBp3014256; Thu, 1 Nov 2012 10:49:11 +0800 Received: from [10.167.225.226] ([10.167.225.226]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012110110482800-901912 ; Thu, 1 Nov 2012 10:48:28 +0800 Message-ID: <5091E485.7090409@cn.fujitsu.com> Date: Thu, 01 Nov 2012 10:55:01 +0800 From: Wen Congyang User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100413 Fedora/3.0.4-2.fc13 Thunderbird/3.0.4 MIME-Version: 1.0 To: Andrew Morton CC: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Jiang Liu , Len Brown , KOSAKI Motohiro , Yasuaki Ishimatsu , rjw@sisk.pl, Lai Jiangshan , David Rientjes , Benjamin Herrenschmidt , Paul Mackerras , Christoph Lameter , Minchan Kim , Dave Hansen , Mel Gorman , Jianguo wu Subject: [PATCH] memory-hotplug: fix NR_FREE_PAGES mismatch's fix References: <1351682594-17347-1-git-send-email-wency@cn.fujitsu.com> <1351682594-17347-4-git-send-email-wency@cn.fujitsu.com> In-Reply-To: <1351682594-17347-4-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/11/01 10:48:28, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/11/01 10:48:31, Serialize complete at 2012/11/01 10:48:31 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org When a page is freed and put into pcp list, get_freepage_migratetype() doesn't return MIGRATE_ISOLATE even if this pageblock is isolated. So we should use get_pageblock_migratetype() instead of mt to check whether it is isolated. Cc: David Rientjes Cc: Jiang Liu Cc: Len Brown Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Christoph Lameter Cc: Minchan Kim Cc: KOSAKI Motohiro Cc: Yasuaki Ishimatsu Cc: Dave Hansen Cc: Mel Gorman Cc: Jianguo Wu Signed-off-by: Wen Congyang --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 027afd0..e9c19d2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -667,7 +667,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, /* MIGRATE_MOVABLE list may include MIGRATE_RESERVEs */ __free_one_page(page, zone, 0, mt); trace_mm_page_pcpu_drain(page, 0, mt); - if (likely(mt != MIGRATE_ISOLATE)) { + if (likely(mt != get_pageblock_migratetype(page))) { __mod_zone_page_state(zone, NR_FREE_PAGES, 1); if (is_migrate_cma(mt)) __mod_zone_page_state(zone, NR_FREE_CMA_PAGES, 1);