From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933118AbbI3Kde (ORCPT ); Wed, 30 Sep 2015 06:33:34 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:28127 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932247AbbI3Kdb (ORCPT ); Wed, 30 Sep 2015 06:33:31 -0400 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="101252165" Message-ID: <560BBA12.5090102@cn.fujitsu.com> Date: Wed, 30 Sep 2015 18:31:46 +0800 From: Tang Chen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Xishi Qiu , Andrew Morton , Mel Gorman , , Yasuaki Ishimatsu , Zhang Yanfei CC: Linux MM , LKML , Subject: Re: [PATCH] mm: fix overflow in find_zone_movable_pfns_for_nodes() References: <560BAC76.6050002@huawei.com> In-Reply-To: <560BAC76.6050002@huawei.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Seems OK to me. Thanks. On 09/30/2015 05:33 PM, Xishi Qiu wrote: > If user set "movablecore=xx" to a large number, corepages will overflow, > this patch fix the problem. > > Signed-off-by: Xishi Qiu > --- > mm/page_alloc.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 48aaf7b..af3c9bd 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -5668,6 +5668,7 @@ static void __init find_zone_movable_pfns_for_nodes(void) > */ > required_movablecore = > roundup(required_movablecore, MAX_ORDER_NR_PAGES); > + required_movablecore = min(totalpages, required_movablecore); > corepages = totalpages - required_movablecore; > > required_kernelcore = max(required_kernelcore, corepages);