Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6743749iob; Wed, 11 May 2022 04:34:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMyjzVJFz017fA0Xm+ZWUnoWcaNRI/nCB/pWwMTgK55yO8BDTmHr8R4YLajomC+pKFEki5 X-Received: by 2002:aa7:d4d4:0:b0:427:5f6:c5d0 with SMTP id t20-20020aa7d4d4000000b0042705f6c5d0mr28982387edr.207.1652268893419; Wed, 11 May 2022 04:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652268893; cv=none; d=google.com; s=arc-20160816; b=Xc7T3mGCwa1uty09DNTqKKi965vTe1UZ53vb1r7oWbtLnm4NsfnaLz500UTkfqTVPb Siv3YmVU8mUw2+AIU8EWDvLnsrGS6II6Hz9HBy/ANkWLz7ArCV4yoBcqDuVo269S8G5X NBRnOty08c40K+uVvm45G/Okt26CT6aLnR6CzkC7iE430t0ZlCsjyTs+aMZvG/JO7WSr fW8zoh4Pwm0J1DOOLjDlUfCPz5eTf73wySncQ2vK4Z6NHalzkD8SgY2SDD/Q7F3vxy5h y6g0fkTO/4f5Z+hbuATdlotKYFu1IltYb22Ef993xzXbG9NNKaNmNBjQKgJ/4yFpHznI 6/dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=0QlUnBGDxpMUc4N72xeQkO0FoIFxPwP0L/YcvB5XQ1I=; b=sAARkdXf98Nm9bWTwvxRbtIWMi/8WJXlg1NIdjGdE5vAqK2xKKb+kzEgawpH57s9/w otCuYtVBDtZ+AilCUvjTmGSq/pFvBB/O82XTdyj5+pgGj80lW0yBeZAOYMydsJkHMpHy kHTm5pDsqv0Lc/xgUBLp2ALVa5s/KVAewtCw0CS3BnMsnUREJnPE5zeg6mkm4FFqhJVP dUL1a5moCnJtIorU8CZSGev1LUPfVYL1TidHhdjoF84xbTfRxbA0XLfIoaegdq/+pxvI W/3U46b432JrMIOSSN1J+UMKJqkLqNc0rwPYVaoJhCmJLnL0VsxXW+0gKD6lWMU8/M6J suRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ss2-20020a170907c00200b006f3a3c6b04asi1857302ejc.295.2022.05.11.04.34.27; Wed, 11 May 2022 04:34:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234730AbiEKFFP (ORCPT + 99 others); Wed, 11 May 2022 01:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234627AbiEKFFM (ORCPT ); Wed, 11 May 2022 01:05:12 -0400 X-Greylist: delayed 64 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 10 May 2022 22:05:10 PDT Received: from esa5.hc1455-7.c3s2.iphmx.com (esa5.hc1455-7.c3s2.iphmx.com [68.232.139.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39C4C1F9A38 for ; Tue, 10 May 2022 22:05:09 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="71958777" X-IronPort-AV: E=Sophos;i="5.91,216,1647270000"; d="scan'208";a="71958777" Received: from unknown (HELO yto-r1.gw.nic.fujitsu.com) ([218.44.52.217]) by esa5.hc1455-7.c3s2.iphmx.com with ESMTP; 11 May 2022 14:04:04 +0900 Received: from yto-m3.gw.nic.fujitsu.com (yto-nat-yto-m3.gw.nic.fujitsu.com [192.168.83.66]) by yto-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id C6026E5BA1 for ; Wed, 11 May 2022 14:04:02 +0900 (JST) Received: from m3003.s.css.fujitsu.com (m3003.s.css.fujitsu.com [10.128.233.114]) by yto-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 199391416A for ; Wed, 11 May 2022 14:04:02 +0900 (JST) Received: from localhost.localdomain (unknown [10.125.5.220]) by m3003.s.css.fujitsu.com (Postfix) with ESMTP id D5879200B3AF; Wed, 11 May 2022 14:04:01 +0900 (JST) From: Rei Yamamoto To: akpm@linux-foundation.org Cc: mgorman@techsingularity.net, vvghjk1234@gmail.com, aquini@redhat.com, ddutile@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, yamamoto.rei@jp.fujitsu.com Subject: [PATCH] mm, compaction: fast_find_migrateblock() should return pfn in the target zone Date: Wed, 11 May 2022 13:43:00 +0900 Message-Id: <20220511044300.4069-1-yamamoto.rei@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prevent returning a pfn outside the target zone in case that not aligned with pageblock boundary. Otherwise isolate_migratepages_block() would handle pages not in the target zone. Signed-off-by: Rei Yamamoto --- mm/compaction.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/compaction.c b/mm/compaction.c index fe915db6149b..de42b8e48758 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1858,6 +1858,8 @@ static unsigned long fast_find_migrateblock(struct compact_control *cc) update_fast_start_pfn(cc, free_pfn); pfn = pageblock_start_pfn(free_pfn); + if (pfn < cc->zone->zone_start_pfn) + pfn = cc->zone->zone_start_pfn; cc->fast_search_fail = 0; found_block = true; set_pageblock_skip(freepage); -- 2.27.0