Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6664639iob; Wed, 11 May 2022 02:38:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztXIXxO0yd1WYW7IXcDD1zXLvO6Ch4Y8VDKN+NC1DGV3rJhPG14I0omLMxkubeb/ldMghT X-Received: by 2002:a17:907:1690:b0:6f5:40d:f4bb with SMTP id hc16-20020a170907169000b006f5040df4bbmr23148174ejc.495.1652261898857; Wed, 11 May 2022 02:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652261898; cv=none; d=google.com; s=arc-20160816; b=GZ6YP4bS2Su49W6h+JUY9K9pAWB+0caAGdzOacbwjbT1cFlfrbI3q2v6e5UXlBnj0b DUNHkJr2PI3ZP9yE9N38tzLH4VuelmSXLVXu1K2O+89i/9BALMIWMmnAPngUu1NVuMCP TEineJciwTiVYl4S8jqa/p/JwdD81jt7E60phVrCfs0u14uxSr+qTpTZsxC6X1G/DY6/ Pfer53asDBDrDHdpIwwM+S97uMC+5V6SrK9WCSTrR64px8rINHrHMG6ZbIGVfySkIEiZ 02K0XvcPm3aNa978iDpL+dQO+1fZag9nldUT5Gjsi7NB2PKnxNuzo9oo0ZLlVNb0QLet CdnA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=vyY+dC8gnVuWY+cPkXf1jPKwxs91fp0C5cCf9g0cCU0=; b=mdSOW3beF8iw9+B++MaC53CTewPu0X1O32Io45mSgFz+nEkQMawtDgdpoFXa0AHsxi 5/uG1us9YhWOM5HWfgl+K+goNptNrvbY0uTT2PjoynAtx7zM7ywAGIALme/lMWqVcio0 Utn+gUVg/PmS1EQhPKu2VtbTafI1PdtXr+USj5WCnV0Cok1g6fgiiDcG2UU/0aSm2XNH POTj7LITIv56sgeoSAJPUpnCvT+cPcEKPQnQSqfhuepJ2DpcP4MAnRciJ3MGLFxfj5t3 cYklUe+khVRkg+wqxNimiVa2yTj2xIm7qyTN8X5pugKY4rl8ZyMXfWvL54DKs5lnYkbX QI4w== 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 dd13-20020a1709069b8d00b006e7f5b1fb91si2144093ejc.370.2022.05.11.02.37.54; Wed, 11 May 2022 02:38:18 -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 S242930AbiEKH3J (ORCPT + 99 others); Wed, 11 May 2022 03:29:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237592AbiEKH3G (ORCPT ); Wed, 11 May 2022 03:29:06 -0400 X-Greylist: delayed 64 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 11 May 2022 00:29:04 PDT Received: from esa2.hc1455-7.c3s2.iphmx.com (esa2.hc1455-7.c3s2.iphmx.com [207.54.90.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8B9F1DEC49 for ; Wed, 11 May 2022 00:29:03 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6400,9594,10343"; a="72307277" X-IronPort-AV: E=Sophos;i="5.91,216,1647270000"; d="scan'208";a="72307277" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa2.hc1455-7.c3s2.iphmx.com with ESMTP; 11 May 2022 16:27:59 +0900 Received: from oym-m2.gw.nic.fujitsu.com (oym-nat-oym-m2.gw.nic.fujitsu.com [192.168.87.59]) by oym-r3.gw.nic.fujitsu.com (Postfix) with ESMTP id F2B8CD646B for ; Wed, 11 May 2022 16:27:57 +0900 (JST) Received: from m3002.s.css.fujitsu.com (msm3.b.css.fujitsu.com [10.128.233.104]) by oym-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id 43885BDC5F for ; Wed, 11 May 2022 16:27:57 +0900 (JST) Received: from localhost.localdomain (unknown [10.125.5.220]) by m3002.s.css.fujitsu.com (Postfix) with ESMTP id ECF07200B31F; Wed, 11 May 2022 16:27:56 +0900 (JST) From: Rei Yamamoto To: linmiaohe@huawei.com Cc: akpm@linux-foundation.org, aquini@redhat.com, ddutile@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mgorman@techsingularity.net, vvghjk1234@gmail.com, yamamoto.rei@jp.fujitsu.com Subject: Re: [PATCH] mm, compaction: fast_find_migrateblock() should return pfn in the target zone Date: Wed, 11 May 2022 16:07:10 +0900 Message-Id: <20220511070710.5576-1-yamamoto.rei@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <2c2900eb-886a-5bbe-f7c7-9d74a6399893@huawei.com> References: <2c2900eb-886a-5bbe-f7c7-9d74a6399893@huawei.com> 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 On Wed, 11 May 2022 14:25:34 Miaohe Lin wrote: > 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 ? While block_start_pfn is ensured, this variable is not used as the argument for isolate_migratepages_block(): ----- static isolate_migrate_t isolate_migratepages(struct compact_control *cc) { : low_pfn = fast_find_migrateblock(cc); block_start_pfn = pageblock_start_pfn(low_pfn); if (block_start_pfn < cc->zone->zone_start_pfn) block_start_pfn = cc->zone->zone_start_pfn; <--- block_start_pfn is ensured not outside the target zone : block_end_pfn = pageblock_end_pfn(low_pfn); : for (; block_end_pfn <= cc->free_pfn; fast_find_block = false, cc->migrate_pfn = low_pfn = block_end_pfn, block_start_pfn = block_end_pfn, block_end_pfn += pageblock_nr_pages) { : if (isolate_migratepages_block(cc, low_pfn, block_end_pfn, <--- low_pfn is passed as the argument isolate_mode)) return ISOLATE_ABORT; ----- So, the low_pfn passed to isolate_migratepages_block() can be outside the target zone. Thanks, Rei