From patchwork Fri Jul 28 17:10:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13331535 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 0A92CC001E0 for ; Fri, 28 Jul 2023 09:10:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DB26B6B007E; Fri, 28 Jul 2023 05:10:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC63F8D0006; 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 9B7788D0003; Fri, 28 Jul 2023 05:10:26 -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 867606B007D for ; Fri, 28 Jul 2023 05:10:26 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4AEB4140F5B for ; Fri, 28 Jul 2023 09:10:26 +0000 (UTC) X-FDA: 81060449652.25.36BD80F Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf08.hostedemail.com (Postfix) with ESMTP id F267C160003 for ; Fri, 28 Jul 2023 09:10:23 +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.56) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690535424; 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=Mpjk2P6RiXjgICoXizaFLfK3UaZ6mz5AsfEmljnimno=; b=T1V/NV1uW6dh57FbD9OkWgklt78Mil/d38L4XqviTMU9qz/DkdlI3eZt5JPQT+OvgguO+F zeNjvNp77nQnQDTcK2OWZ10xhau1faVYjI2n1g+VE89AUnx44AILQW8ALMJ2teYvI5tbz6 TlwcI4FhJ77l2SZvUTxaiY09mq4LSsk= 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.56) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690535424; a=rsa-sha256; cv=none; b=0i0RBQXDIUHSkjyKt0jJnZ4JRz1Acu7GL4EAx+tXYdxpa8M+0yoG3mqhCjuGvDDkxp63Az TNFEdwB08lK5k4Y94Oxjien34xczAGF2xconyS8gDG6j1h9u+8As9TJSEW3GBi4Q0TInPp oCv627vT1TshNKUuDyOtaCwFlcn5yLE= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4RC20P673Qz4f3nyg for ; Fri, 28 Jul 2023 17:10:13 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgA3n7L1hcNkCrD+Ow--.32454S4; Fri, 28 Jul 2023 17:10:16 +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 2/8] mm/compaction: correct last_migrated_pfn update in compact_zone Date: Sat, 29 Jul 2023 01:10:31 +0800 Message-Id: <20230728171037.2219226-3-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--.32454S4 X-Coremail-Antispam: 1UD129KBjvJXoW7CFyfAw1fGrWDCFWrZry7Wrg_yoW8WryUp3 4rCwn7Kr4kWayUZFyYy34kZ3WYkwsxKF43ArZ8Jw18AFs5Ka4jk347KF1jvrWUXrnIy3sY vF4qga97AanrZa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBK14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2048vs2IY02 0E87I2jVAFwI0_Jryl82xGYIkIc2x26xkF7I0E14v26r4j6ryUM28lY4IEw2IIxxk0rwA2 F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjx v20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E 87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64 kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm 72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYx C7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_ Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x 0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8 JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIx AIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7sR_veHUUUUUU= = X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: F267C160003 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: oob15jb88eyj915t3xudcfpkq4pi8xok X-HE-Tag: 1690535423-406609 X-HE-Meta: U2FsdGVkX19AR5H0lLoz0vvjaGAO9DHjb8dgSem5ekTiMmtQu7DGWUWde1AAYgbbMV7ZNMDjOUL+JUPeLqgwZeLFQnFPdG2eZ0EyvP0VkrNBJLsaAqJmaYxrGw7BsvlTSt/EHlkX/Hrry3jKJ7K0S1YbJ99Bv5aji6L40a8MxksOHPjSGWGlOSS5FX/kmncUCzcydXnIBbbmAu0WSntieUZJ6h9aYIvXrwX8G/GIOtbyOQznryAoHmlpZ1iv3Q1mTYw3nbWr+AhaPShiI8Zd9vZ2qfRMrwcUx6RWd6nRjyB2U8HeWAkalnyrxisAwFWaI6W7cFotyNKYHffjl19D0qf9NxnYUn0uFsGQeEitBuaMEWpHNd6uSdUyE7DgjJ5OlelwgOlVLYccuDEGLDUBJEt9ZrEA+jGH5sVJPKBjPv72yq01kwIvGevqt0W2k/ceoSDdJmNAv6GGuYB8QdH2LID4ZFXDGb13jGo6w+8pZOxOmcSVZALKSMCg8w1ub1PBW024KjQSoNwMMCj2y44Fiog82B4spLez0N8ue91J1LUHdr7djlGu+ckb0Pvc50M9vjd6G41ZtvZvyaGBCexcQY5wskKnw6SrGFL9blyyDsgTmiW3mxYlFAEXzwUD2zbtozKalq74NbNekVJenmrG9UaHfn0q6RDEWUC2q/uLyeq/sjv90KGz/iUD3+Dcz0YnBzZan8uRERcIawwEosPAQ4INkuU8tE2MMfqInqdlBxyTcOzTzGOtoqj93sVEzYCpa1+BO8g33+nHcS6oVfsU+yBlS/dXCJ3cXTJ3DzVhvITl4Tya+CE5NIia3BJVulKxuQDqJQAIZXvxZlDt/Gw67u5uafNwmggC3nt1Zqe7BXO7YRI27Lj+TZZsgsi+aIO7oOKr6kxHbArNRUaxjDkI8fubH/f+OnkePDHmgo8ghnJ8Ejt6t50wYhVQqYoycmGubGws1Jb9GwL56LI0cxP 1ZVFwdib uXiHolqAxL5Gvh3L7nRxcrJo3Z5HBvOzozmqB3RSk5D9nwbgnWNDAzyNL/S6a2tWtLThb+8+tUQCmnSNciW9OzB/Lj+ZblsgMKsuj/4JxN2zcjN37WP5OZ/eVr9c0GrvY0eYs0VwHTh+4NooWR0vhxCGHlFwaWo6iBKLkxtPaI9N1jhPKKz1WqPssqDxVR9RYtAvCoCYL1/8km5YydzhMrNzjSpiHCbABQbS4gX7rGE8N7EAEFLRMDlH5JEM5qxYvlPcCvqYUnBhO++GTcNa2urSMruGMHDxMAixE6QZy7ceKfIPJdvcDvvnO0SniDI2K5rIH 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: We record start pfn of last isolated page block with last_migrated_pfn. And then: 1. We check if we mark the page block skip for exclusive access in isolate_migratepages_block by test if next migrate pfn is still in last isolated page block. If so, we will set finish_pageblock to do the rescan. 2. We check if a full cc->order block is scanned by test if last scan range passes the cc->order block boundary. If so, we flush the pages were freed. We treat cc->migrate_pfn before isolate_migratepages as the start pfn of last isolated page range. However, we always align migrate_pfn to page block or move to another page block in fast_find_migrateblock or in linearly scan forward in isolate_migratepages before do page isolation in isolate_migratepages_block. Update last_migrated_pfn with pageblock_start_pfn(cc->migrate_pfn - 1) after scan to correctly set start pfn of last isolated page range. Signed-off-by: Kemeng Shi --- mm/compaction.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index ce7841363b12..fb250c6b2b6e 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2482,7 +2482,8 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) goto check_drain; case ISOLATE_SUCCESS: update_cached = false; - last_migrated_pfn = iteration_start_pfn; + last_migrated_pfn = max(cc->zone->zone_start_pfn, + pageblock_start_pfn(cc->migrate_pfn - 1)); } err = migrate_pages(&cc->migratepages, compaction_alloc, 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 kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0pRKFAPU UUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 3D2F916001B X-Stat-Signature: ac9auhy4babkmxwn54tyu8bh57eaa9df X-Rspam-User: X-HE-Tag: 1690535421-599550 X-HE-Meta: U2FsdGVkX1+zlSsnAzhCKn7zTgEc3Hb8k6Kf9uPYOnwv4K/EO4N6GMP0SJKziTELvGEZB+YYpajI8/G1Z2rzA1RsosIKWxi1VYDb2DN4XQN8qT3QkJsXq5nVmYTGKQ6+cLqgKwhRdbr16Vnxnf6G1iwwLX7LHsgQeADIcNeyKBtEuRt+J9gN1zxJuZ2GtaQpnQ/sGl5ZF6YHYCW/XB9uXTHCwu4fGGoATnWeLUfGqtnBckejiQU22FMRBjQlnOJ4qA+xgENz+4Nx0Q38o+82+RGyrHjoG91qUasYUzW2d/zCFCZ4wQ2NzV5XbzSZH2hHG54sRs3qWtL6zMnOwePDSkZpp23/pNIWP31gkwWwZjymoi16MQPoPzkNedxGDZhW7INjLv9yBcreMm7NMpnqGzz3Aop9F45vyJLDCKoJKz31YzQfY5mac2aP1ilMO+DrWnbjopKgCJ0zyxF4jxnw43PszBLCHPEHLV8YLEgzBKxok8ETDZYtYpJybJ/LBKIGH97b/G5D+ou1DnNqg4uWmZ/kXy5EzKQP1ZksyRjHL35Va3yyl3AugSJLbY8fdcHk8Y+pxs2IbdebwpRZDHUCJIpZY7bbYpRfVe62VItJGJSE52EUqqFJHL02oEdOOiSWYpWbsqsQnL/zRhTQENIEe12ryMXCk6PESkKwtZodc4DPHLHu1Km4Wvx8W40uN//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; /* From patchwork Fri Jul 28 17:10:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13331536 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 E411AC0015E for ; Fri, 28 Jul 2023 09:10:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 155438D0005; Fri, 28 Jul 2023 05:10:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1059B8D0003; Fri, 28 Jul 2023 05:10:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DAFC06B007D; Fri, 28 Jul 2023 05:10:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C17178D0005 for ; Fri, 28 Jul 2023 05:10:26 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7738F140F8A for ; Fri, 28 Jul 2023 09:10:26 +0000 (UTC) X-FDA: 81060449652.19.1730ABF Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf17.hostedemail.com (Postfix) with ESMTP id 26A854000B for ; Fri, 28 Jul 2023 09:10:23 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=none (imf17.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690535424; 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=IX2xAfEp8ZVgXbkaWKLtfcUpvHjyvM0q566WPMqN2WI=; b=HXVgZTNBusj7gr4hJEbtMo8MmRoBGO0mij3DXJxbg8FDaSKLHqOHTKwRikbhjel9fu0WnA F6Epmzjj1mRk4IYhXjazf7vZgfwVU/UeBRGMbM4gxmHPn7oa/smwKyVIHWvZm2ZmBn1C9V CabaNC+SNOQruBnT0NkRHpO+Z6qd09k= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=none (imf17.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690535424; a=rsa-sha256; cv=none; b=v+65cQcTOqMiJVMgbi4ZPKPlS29+fvE58sNe6aSQUJrT/PJov0JdubNG1uXrzx1/7oSqqD csZItWSpYiSWasItD2A0vHuXSQNV8p8LSwicdoqav+9k71Rrznm2+Nb11AbJ3DzmXW2NCx YJ4VDrh8jxbxdoAKwtjnzESSU4MA4lo= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RC20T1C9vz4f3kk3 for ; Fri, 28 Jul 2023 17:10:17 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgA3n7L1hcNkCrD+Ow--.32454S7; 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 5/8] mm/compaction: corret comment of cached migrate pfn update Date: Sat, 29 Jul 2023 01:10:34 +0800 Message-Id: <20230728171037.2219226-6-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--.32454S7 X-Coremail-Antispam: 1UD129KBjvdXoWruF1kGw4xtr1kGw4rtw18Zrb_yoWktFX_Xa 1xtrs0k390kFyvqanrAw4akr4UGFWDZF1DG3Wktr47CFyvy3WDZ3WDZr1fur90qa9rWr9x Gw1kuFyjkFyakjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDkFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AK xVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr 1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7sRRkucDUU UUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 26A854000B X-Rspam-User: X-Stat-Signature: 4whkpot1bib38kaaokjpxgo66f6idjsn X-Rspamd-Server: rspam01 X-HE-Tag: 1690535423-292606 X-HE-Meta: U2FsdGVkX1+NtaoTPw7afW+Y1j3vwTsiEl8wASWeae4zSDLb3TK89p84s6Iv6Fii2wxbezZny+fpH95fYb8FsoYghsQMZoKyKJbXPVkQSWaOPbNnTd+VwNHJDMTrE+KqA4A2p4elo8ztjW9KTn3hUogxzoJ+sfsF8vxGKBSNor8AR/d+/Cn2ZrquGZ7p4UW3vqAbdz+llNoNR8nwd+Y962vkMgeEiFhGdtmu+D1So1JDW9p8xqavU4wadDMdBRTrRs40TSfGCa464VnLxJ59rJNRfUQNnHf4ZBXnlDu7OToERLIErV3AKMAaUT6RugDjpnhUK7Q1HFXmnr0N7fmuymOiPPC+JTtHZutmVNHHEZA78XYT9McnTItTT5OxIvCeTbs7JpGsRw0STDE/lBdtOTBlZSPLSpEpFlpXcfe+ebFjRZm55fVvBXE9x77ZpMcGuuNHbW0D+ftvQ6QY4OV81NTLD/uH1ymRMHZSLDYmcCk/TtJM/KMzhACyXnsLOhewBrdfDH0XnFq9ATnvwjGvs4O0GPiHexnhOUijKKWPGwmLXkk0Jc+tuB6rs1VPfoNHJEDaTJDqlw9xJCuu9vZyHuw8faSQb6fMiNCSwzafHRHBe11vAI+q590tWaDUmh23kEAhEB0kp8LiRPaYzXovuJyDghCiQSt5dxs7yJCYOzTQj4xXGCQCVJ6pPKGL0IdM1NpxCeXraM/JlCCvsF1frSJHlkeya74MHzMNEei8lUtwm13ZRvr3qc83pClR0MW1rdaA0jBNKN/q1bpaUxTis3eURYuG7kCh8S1yu6/By6YyjgZimkTfpCUhMVpDqqPXjFrjsGmIIEL6R/e8iD7mkszLGtUMUQGyKNzWZHlieZ5+MaG12hzwDE48gFX2c+bT0XTGHMvo7kLwrLuWy2wf9vAxlS3mnW7uKiiteQ+SqMwSbPQ5LD67GLotvM8xBbvLq9YNrbAXAAuMGPfLDYM ulNKoshJ K+4hh1TabIYoWUiZelokc0PDusdOxbi3RmHOxbZZpboEBQFVeCxJoTrz9qcttKDqBoChs2K/VficBFYMAUikTc1IwR4+QziQkAj/oO6iRzv92CPb36/b8tLmlRxrAUabPL9AaFX7yu4V414Jx6pkUHvFGtHtVsLDWdvOvWvAZTZhAKDyg9rTnWG++PLmOjn410kREr/4FqCIfwr9p3slF6NmeDg9b6lIprpIqFU/Qnp+miV2HoVa6N/23fKG6JvOEyxHd+JTvsJ93sqg= 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: Commit e380bebe47715 ("mm, compaction: keep migration source private to a single compaction instance") moved update of async and sync compact_cached_migrate_pfn from update_pageblock_skip to update_cached_migrate but left the comment behind. Move the relevant comment to correct this. Signed-off-by: Kemeng Shi Reviewed-by: David Hildenbrand Reviewed-by: Baolin Wang --- mm/compaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index 09c36251c613..1eebb61a1f63 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -464,6 +464,7 @@ static void update_cached_migrate(struct compact_control *cc, unsigned long pfn) pfn = pageblock_end_pfn(pfn); + /* Update where async and sync compaction should restart */ if (pfn > zone->compact_cached_migrate_pfn[0]) zone->compact_cached_migrate_pfn[0] = pfn; if (cc->mode != MIGRATE_ASYNC && @@ -485,7 +486,6 @@ static void update_pageblock_skip(struct compact_control *cc, set_pageblock_skip(page); - /* Update where async and sync compaction should restart */ if (pfn < zone->compact_cached_free_pfn) zone->compact_cached_free_pfn = pfn; } From patchwork Fri Jul 28 17:10:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13331533 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 7647FC001E0 for ; Fri, 28 Jul 2023 09:10:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39F3A6B007B; Fri, 28 Jul 2023 05:10:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 32C688D0005; 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 13C236B0078; Fri, 28 Jul 2023 05:10:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id DCB346B0078 for ; Fri, 28 Jul 2023 05:10:25 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A57BEB1EFB for ; Fri, 28 Jul 2023 09:10:25 +0000 (UTC) X-FDA: 81060449610.28.B5FE47F Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf04.hostedemail.com (Postfix) with ESMTP id 650BA40016 for ; Fri, 28 Jul 2023 09:10:21 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; spf=none (imf04.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none 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=yNLpwsojZtnUrJ8c6VmeMk/OKHNgg+Pd1halO2UWgAc=; b=Xalt090PTgMibOoyOnid5E3XA2k4VRAYkVaGmVMZMbWnrx1HoRQb8lFI4xSILCdgr8mRAM A/pqcGDci79m7kKOANcifNBY0EVHgnvEDSp8McW3FliHt7xV50G47Cp5Il/zjFGWycHLex DPETvoyXN6So8d5GoZG1S5a9zoQUNz8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690535423; a=rsa-sha256; cv=none; b=8JXXA6sFQcSCLAHTcMLd/axd3xaQ0Xxw5Ojy1c9br02eBDqhZHNF9gnvWiSI7wtDiScTrK oIrBFzw3smm+LvdPHT1M1SaCzFchXxw+pF++AxBhwDNYCj948Bs2Ovk0cwhJkeZ8shcF4T zBJrclKjAbRZvDOWGF4oEMVANikO5C4= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; spf=none (imf04.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RC20T48jhz4f3pC9 for ; Fri, 28 Jul 2023 17:10:17 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgA3n7L1hcNkCrD+Ow--.32454S8; Fri, 28 Jul 2023 17:10:18 +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 6/8] mm/compaction: correct comment to complete migration failure Date: Sat, 29 Jul 2023 01:10:35 +0800 Message-Id: <20230728171037.2219226-7-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--.32454S8 X-Coremail-Antispam: 1UD129KBjvdXoWrZF1UKrW8Kr48JrWrWrW3Wrg_yoWfWFX_Zr 4Iywn5Kw1F9r93AanrCa9Iyryagr48Ar1UWw1UGrW8t34vyF4aq3ZrAr47Zr95XFWvg3sx u34vvr1j93ZakjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AK xVWxJVW8Jr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0pRKFAPU UUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 650BA40016 X-Rspam-User: X-Stat-Signature: hapmnm4q7en8fweo9d89m5jf8pc1ogzf X-Rspamd-Server: rspam03 X-HE-Tag: 1690535421-393757 X-HE-Meta: U2FsdGVkX19G4ndzD5pZaRlit+FKaWzutrXv7eLBnipm82foZO3sVT+lUorD72wUYZ4VFBk3hUbQ7QJt6+MrMCrJ0j30JnUq+suuK+NJS/HLrYMtxHFZUV9ISGGXq9rb/m3b5OmZtqMFq6Rjo6nUv2UhrREMoJ52AQ/j2XDMDui40ySEbDwmDYtVRVmGOHCb3oBbEknknCVtLhq763zUmMiK90f6iTW1Pb4frIWCWG3H1l8CKncg4Th9NCyfF2cYRHONMWHMfNKTQy5CfQkwZmzIOrOmSarA0mRSlPzPECtYy9yxaAap+UgaTCXmFLMGKNtuNOlFhLcCUq+MbXvr1emiKrDcsDMVWrnQQtewxdgWlpgzPLruJ/zVtHl0f5259p6z3v/MUAjNpxbqbA5+7mccIBrJMkmRp+xzjXGL5mZhodq4zoCi+oCbFeQigE88a6nEFdZzWruemyd7Q8NEvUow3RVyipmOFaCPWFG0AZEMEOdTGjVGdMjzPLhIepDJguV0Lfvq7DinxVvPTa7f1mkLoOMfgrEsC0InLVpDc4J+k6HXpwx+qHCA6gM0D+3lnEY35a0lPMGvmyFnf+Db9nJB1Yh4VXXhfPDj6cRfg6hiH96Iw/EF23akhCooLUbC74vZE3agcGv5p585WMYHflIQlZUvHiGzLhSNg4+/RFzMdqEX3hABaLfiYfeYdnt5a5H5WGlxfc3r117tvc4UYT47flV+jKW5WZ/K6lNNfuuy4rqaAnvwHJVlFZU0TrSwcRLznAQO6GtIHIv7bWcr8kpe2C1UMwodK29OfgqIOudTKtZ5KR+JHZWNzc95bShIIrBQzkjZ77XxWxXJfgcnTfpypaypIJtK6njayjt68djbRKNJ6v4tyeVyfM3078Z8LWiIu90OP1ADVd65y3Bb62LH2sdrdQMN1dvYrsJCs0Vfx4wGovq18JCaNpCtld36LXleXKEhNH+tv7pcxgS agf2Kqh4 M1Zut7GcYSSmTVH/snTQLPTDaLb1u1qi+aycuVGNFeraB6h/yPj5A2VKnZLEMgFxU3FqP9w0J3crsZ6dnPextX110l1B33y7pLPqnn2+Ij09YKs8U/YSpLlZyD6FZokoBz0b+SqHWCXZiP3VCJpVwB/Vp2aK317rv//8G+PT6Zi9rY3nt/h4yrdIZCwKipOC6Qs5UIPT7O1JWEkFpwzblSMsY7EkxTZWr7WN7gBK9+cRHTzHRyTit31GCKiijFtMyCMxiiYCqRWydPSbgf+rbeYG1nZCwwwGSasS0 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: Commit cfccd2e63e7e0 ("mm, compaction: finish pageblocks on complete migration failure") convert cc->order aligned check to page block order aligned check. Correct comment relevant with it. Signed-off-by: Kemeng Shi --- mm/compaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index 1eebb61a1f63..6052cb519de1 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2497,7 +2497,7 @@ compact_zone(struct compact_control *cc, struct capture_control *capc) } /* * If an ASYNC or SYNC_LIGHT fails to migrate a page - * within the current order-aligned block and + * within the pageblock_order-aligned block and * fast_find_migrateblock may be used then scan the * remainder of the pageblock. This will mark the * pageblock "skip" to avoid rescanning in the near From patchwork Fri Jul 28 17:10:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13331537 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 D1B15C001E0 for ; Fri, 28 Jul 2023 09:10:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 944938D0006; Fri, 28 Jul 2023 05:10:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8CE498D0003; Fri, 28 Jul 2023 05:10:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FC0B8D0006; Fri, 28 Jul 2023 05:10:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 589008D0003 for ; Fri, 28 Jul 2023 05:10:32 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 33E4BA0D04 for ; Fri, 28 Jul 2023 09:10:32 +0000 (UTC) X-FDA: 81060449904.26.2F234D1 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf16.hostedemail.com (Postfix) with ESMTP id 42ABA18000C for ; Fri, 28 Jul 2023 09:10:27 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; spf=none (imf16.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690535430; 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=qj0nYBSsAC2wvn2l1Gxd9Hb49uXKy1ml83q/tUvBcI4=; b=Lr8sb9Tkec48YQh+ES0ZzUI5O1CQm2uuMn+oWdoK7fvJpUzORGWONRELSLuejsM93ik8ND 8M7fMYRbNcIQ6sAKvZHZJXZX75GqZoo9+zdNL0On+fBdmcrRqBW74E1mqgIIhLnE+bM96/ DPdO3dbuus7DUou/Gss8dcNYA3d0BRo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690535430; a=rsa-sha256; cv=none; b=EW3VYbIFkL6adjLJW0+Vv4MSPjDsGGsE7EYGJ8eCayWN3jM233oopLcKL67TWNJ21g+O+X Cp3xfo4OSvQ/6sj+UwxkcRe/T3fRX05137lOuWHG/y6YzAcXmlbMhqChF+RGx0xYfr21wA IM+vq+ure+VMbGLb/WPfJdCxC6yfnVI= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; spf=none (imf16.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RC20V2t72z4f43L9 for ; Fri, 28 Jul 2023 17:10:18 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgA3n7L1hcNkCrD+Ow--.32454S10; Fri, 28 Jul 2023 17:10:18 +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 8/8] mm/compaction: only set skip flag if cc->no_set_skip_hint is false Date: Sat, 29 Jul 2023 01:10:37 +0800 Message-Id: <20230728171037.2219226-9-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--.32454S10 X-Coremail-Antispam: 1UD129KBjvdXoWrtw4ktF1DJF1UKr4fGr17ZFb_yoW3WFc_Jr n2yF4Fyw1Svr93AFn8uw43Cr1kKrWDCr17Wa4kXr1ayrWvya1kX3Z7Xr9xXrn8XFW7W3sx G3ykZF48GFyS9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AK xVWxJVW8Jr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0pRKFAPU UUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Stat-Signature: f3dbfb7bqsqbr49fzhchsudfa177zwdy X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 42ABA18000C X-Rspam-User: X-HE-Tag: 1690535427-309204 X-HE-Meta: U2FsdGVkX1+ouWWWpgbE7pbhs/Xm8+NPfz1luxSbeSa8QwNGEYgr+o+QvjW7XLk8pOsUvxA8TbDl+JSCmSQuyInwyGb0elKw/2xJgZTbrvqL6LILBu+m4GISk8xNm5mEfeDzb9iTm7qSkME06rs2Oj2SR/FYb2PdbiKqLQShhPGaxMIF0hGf2u7itdc9hqak1AdoG+EBwQFY2Gk0BDu0cs579g6Q/gLpRUMFuP8aS5WPsPURd3/doa3EO54nz0jP5J19R+pN/dQYv6p4RFO5/tJxWofhUXXChxBzxUq7X5NK1sVGc/YwndDUEDMO1M96mo36HnRt6N0StvwfORdvclHvjhPpa49oIfkoB0oPsBrgIDBF8X5yf2EeXw13TPyF0zWl4u01s7Nl72231Uh3HsYuxlPQn8j2u8OrhOtJAnRFVUvfFwt9zkJmmBDzyWgKriTMkNRQttc7uJAOvo6Zgy97pMHl45trL7F6HDflu8Bbc9eYsEshR5xEYhSJzJUSr+NAlINeKFhBZs99OZfS732QKm2+rRBjFqvsiR2Ho4VgfYDpZwJ86TvRXPQXlOyTtOPh9/VCailM+0Gp9Rg6lVk+83m5BSGflAS6YQgItYGyo+B/K+pmVMu7YL9fLAtRSE1IClwOanCWB2qLtlXUUOlcJSeD2+tDQkECdo9kAU1BiJ0Qx4ihjROdlHl51x/v8Mj0ddtyoBG/+TscWsZkN8l8iFStat12dP6Y3w660A/fqAYACZAshmdpK2S8Gur0AG54Vdv5NQVUaFmRlUFKC7lcYF4YAeqPLiBQcN7QOKO1gaplPdfqK8o7YnCaNvgrXXoEuhMPfmkQ1j1C2el0hAlJx733rV4MJ/oGHxpbRIHzSNY9IVG1UqduVGYXy0KV3BUGPs9YdTRB129ILXQMesu251U6yVJYYMaFw6PTgK8TN43txbO8tYohCxht7pf/PWQ5RkTB/s7EC/L6Pnc rlQjvQYk Hs6yRrl3JyUeQBueQT9Fa60PYAX4v51oktJv5GTFAEI4LUoR+h/Sdcid4OFhrMbSkzF/YFsKHKDRIDdPBm7GqKtVuVeOVraW+Cy/cu06kbpFmaU93L4xKuzK4Gdpd2LD689qawz+UpIoaDwzsUpMespeq5/mrJMgxdcFdPNjar8xywZqR2gn+sM9tQI1fv26Dt6oUsxwjLyG11fKSS/OmvpIe9uN6m+fRbvjpTORokFuUltIz4tmNxSgoerV2hn338DMwdumCmXRJ3cuUOFuMQ9zDoJXNMLN7Rk7MVgEsKRYsHQT/0UpZiYlzNDorFf7/S9O8 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: Keep the same logic as update_pageblock_skip, only set skip if no_set_skip_hint is false which is more reasonable. Signed-off-by: Kemeng Shi Reviewed-by: David Hildenbrand --- mm/compaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index 188d610eb3b6..6841c0496223 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1418,7 +1418,7 @@ fast_isolate_around(struct compact_control *cc, unsigned long pfn) isolate_freepages_block(cc, &start_pfn, end_pfn, &cc->freepages, 1, false); /* Skip this pageblock in the future as it's full or nearly full */ - if (start_pfn == end_pfn) + if (start_pfn == end_pfn && !cc->no_set_skip_hint) set_pageblock_skip(page); }