From patchwork Fri Jul 28 17:10:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13331534 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 76494C0015E for ; Fri, 28 Jul 2023 09:10:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 684036B0078; Fri, 28 Jul 2023 05:10:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 57F708D0003; Fri, 28 Jul 2023 05:10:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 39D746B0078; Fri, 28 Jul 2023 05:10:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 091148D0003 for ; Fri, 28 Jul 2023 05:10:26 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C5E0112090D for ; Fri, 28 Jul 2023 09:10:25 +0000 (UTC) X-FDA: 81060449610.30.A0F536A Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf08.hostedemail.com (Postfix) with ESMTP id 3D2F916001B for ; Fri, 28 Jul 2023 09:10:21 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=none; spf=none (imf08.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690535423; a=rsa-sha256; cv=none; b=RM9ArvnebLwjxjVjYAPq6erfQuIydWaZ4b66PXmZHT7IvetS3SIHBtoE+EVyckD3Xz9Dou HeOy0rDMwafs+Znizk8hw9CeQsZIyVtf6hCTOTtJkV+DkNlKn8/V8MihRk13knqpS/slyh vyo3s4eaUBCDoXcFu1HoNdH4iOZE4Z8= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=none; spf=none (imf08.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690535423; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vnh3A0Em3JneUg74kv573qyZagn0gQqMWRVEbRoAVfA=; b=pvI9b6HNbLQzv86JTDf3AtxeTEifKszkQQ5fix7HPnQTiClPNnz3njqnRRsBnZfprpzvVj Y5kSGz9t4xkaJqs/yddlOCNAiRWWm4/XLeKfg85tUl4a7rDrieMwqJzazkRNXiz/KJeUmm g28s4hWLJRZSqxX/8UClELfJImCXgYY= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RC20S5N5fz4f43Kr for ; Fri, 28 Jul 2023 17:10:16 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgA3n7L1hcNkCrD+Ow--.32454S6; Fri, 28 Jul 2023 17:10:17 +0800 (CST) From: Kemeng Shi To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, baolin.wang@linux.alibaba.com, mgorman@techsingularity.net, willy@infradead.org, david@redhat.com Cc: shikemeng@huaweicloud.com Subject: [PATCH 4/8] mm/compaction: remove stale fast_find_block flag in isolate_migratepages Date: Sat, 29 Jul 2023 01:10:33 +0800 Message-Id: <20230728171037.2219226-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230728171037.2219226-1-shikemeng@huaweicloud.com> References: <20230728171037.2219226-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgA3n7L1hcNkCrD+Ow--.32454S6 X-Coremail-Antispam: 1UD129KBjvJXoW7ArW3uFWUWF1fuFykCryUZFb_yoW8tFWxpw 1fJwn7GF4DGa43W3ZIqFyDZ3W5Cw1fKF17JrW7Kw18AFnxtFnF93Z7tFnYvFyFqr9avF90 vr4Dta4Iya1jva7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPY14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2048vs2IY02 0E87I2jVAFwI0_JF0E3s1l82xGYIkIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0 rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6x IIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xv wVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFc xC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_ Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2 IErcIFxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIx kGc2Ij64vIr41lIxAIcVC0I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x8W40uN//UhRuwdAjtAZith2l3WcL6kKZ83NwGRLl/6ANHqDW/HErigft5QV9Is5h2WlEyT8l5ltv8+s5waVyWE/0z2onZRJAP7ky6q6VCJTAjVcfJM+I+jrqnBCbZHswBQkh5+jpDkNQ70bmnBq1knZT216vks2Dxr2ZuTQdwQ3bKaZ/mGF4ZEQqYEIJppmL9rz0ejalzdZP21VB9vlJ7ow/Ijii3RDIYlzfLgMVnR7m79/n+zA49P7oLd6co/MRwP/zbR3oaYJp1FSNgWAAx+jeMGu3 EEGK+eki lmKjG8Hrp0Z5BML79/zqcz4YBL3ZqpSdnilCq6Dc9qtrrHGN90TjrLOEZtXEdw+dgXME4X2qLNiIFkJW8fq9STrUclkldWNRnLFHV/Jg0N+ffD88ns+epwcc9uSZsynZ4nWx/MNbjFsEALcNhuk+y5k4uZhyjQlTv5RrQJJLc3JOsbIkcNkTg21FXU9wfKIdwVNowTCTvmqPZNMba9ND5UtOGityowBEYTXuNghLT54Xw097RJyYqqYyX4iQIp29XAV2/RsGmpemJL65QqTVgdGjTmCXbXXViJSXllMJuZxqjs48glYln4X9y+g98W3V5XSf2 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: In old code, we set skip to found page block in fast_find_migrateblock. So we use fast_find_block to avoid skip found page block from fast_find_migrateblock. In 90ed667c03fe5 ("Revert "Revert "mm/compaction: fix set skip in fast_find_migrateblock"""), we remove skip set in fast_find_migrateblock, then fast_find_block is useless. Signed-off-by: Kemeng Shi --- mm/compaction.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index ad535f880c70..09c36251c613 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1949,7 +1949,6 @@ static isolate_migrate_t isolate_migratepages(struct compact_control *cc) const isolate_mode_t isolate_mode = (sysctl_compact_unevictable_allowed ? ISOLATE_UNEVICTABLE : 0) | (cc->mode != MIGRATE_SYNC ? ISOLATE_ASYNC_MIGRATE : 0); - bool fast_find_block; /* * Start at where we last stopped, or beginning of the zone as @@ -1961,13 +1960,6 @@ static isolate_migrate_t isolate_migratepages(struct compact_control *cc) if (block_start_pfn < cc->zone->zone_start_pfn) block_start_pfn = cc->zone->zone_start_pfn; - /* - * fast_find_migrateblock marks a pageblock skipped so to avoid - * the isolation_suitable check below, check whether the fast - * search was successful. - */ - fast_find_block = low_pfn != cc->migrate_pfn && !cc->fast_search_fail; - /* Only scan within a pageblock boundary */ block_end_pfn = pageblock_end_pfn(low_pfn); @@ -1976,7 +1968,6 @@ static isolate_migrate_t isolate_migratepages(struct compact_control *cc) * Do not cross the free scanner. */ 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) { @@ -2007,8 +1998,7 @@ static isolate_migrate_t isolate_migratepages(struct compact_control *cc) * before making it "skip" so other compaction instances do * not scan the same block. */ - if (pageblock_aligned(low_pfn) && - !fast_find_block && !isolation_suitable(cc, page)) + if (pageblock_aligned(low_pfn) && !isolation_suitable(cc, page)) continue; /*