From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54EDEC433EF for ; Wed, 11 May 2022 06:25:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E30046B0073; Wed, 11 May 2022 02:25:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DE0568D0001; Wed, 11 May 2022 02:25:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA8886B007D; Wed, 11 May 2022 02:25:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id BD6226B0073 for ; Wed, 11 May 2022 02:25:40 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8BE6E21FC6 for ; Wed, 11 May 2022 06:25:40 +0000 (UTC) X-FDA: 79452476040.08.B1920BE Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf03.hostedemail.com (Postfix) with ESMTP id 9EF0820095 for ; Wed, 11 May 2022 06:25:31 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4KylCN14N4zCsYT; Wed, 11 May 2022 14:20:48 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 11 May 2022 14:25:34 +0800 Subject: Re: [PATCH] mm, compaction: fast_find_migrateblock() should return pfn in the target zone To: Rei Yamamoto , CC: , , , , , References: <20220511044300.4069-1-yamamoto.rei@jp.fujitsu.com> From: Miaohe Lin Message-ID: <2c2900eb-886a-5bbe-f7c7-9d74a6399893@huawei.com> Date: Wed, 11 May 2022 14:25:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20220511044300.4069-1-yamamoto.rei@jp.fujitsu.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Stat-Signature: byx63xnzarkcdt5budifn7dkpkum9jnj X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9EF0820095 X-Rspam-User: Authentication-Results: imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1652250331-761628 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2022/5/11 12:43, Rei Yamamoto wrote: > 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. > IIUC, the sole caller isolate_migratepages will ensure the pfn won't outside the target zone. So the below code change might not be necessary. Or am I miss something ? Thanks! > 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); >