From patchwork Wed Aug 2 09:37: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: 13337509 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 8D373C04E69 for ; Wed, 2 Aug 2023 01:37:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A2B79280115; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8EE2C280114; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 677FB280110; Tue, 1 Aug 2023 21:37:35 -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 5344C2800C8 for ; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2B842C0426 for ; Wed, 2 Aug 2023 01:37:35 +0000 (UTC) X-FDA: 81077452470.14.7706B6F Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf05.hostedemail.com (Postfix) with ESMTP id EFFB710000F for ; Wed, 2 Aug 2023 01:37:31 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=none; spf=none (imf05.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=1690940252; a=rsa-sha256; cv=none; b=7RohjTXFwdU787tPQ3Xy2MIvwXXn9CCuL5NObuwwD50/timUvbb6YHrktB+um/66qz/Lk3 lYi0aP548ie/59EZxX9tS0u/XeXH60kuuOaDeNc7w7eHCfZ15eEqBXpRopUW3v2Q3Wh8aX BduomIWKD3i3W0v6/jQEFiv1Od4qAcw= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=none; spf=none (imf05.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=1690940252; 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=pdRei9fGJiN18feezXtlCPg8SZ6q5avN8dZRCRdO4gs=; b=3souoTyvQQjo9j43E4OX9yog36g2MwHWhtcAWjjS6Vv3GswIN560prHqC6P9drIEzHKwFT X7xDQdZvp19j76uZKQTWwLpTN+MdBQuR4QVnDAGuIJyUhPQF9+rFty1uondTkMlFBePh4q 4Orwg8IcP7ABPxAJInEpBV++SWz0vcE= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RFvjf5kgxz4f3pBm for ; Wed, 2 Aug 2023 09:37:26 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAXzrFTs8lkvrtvPQ--.56352S4; Wed, 02 Aug 2023 09:37:27 +0800 (CST) From: Kemeng Shi To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, mgorman@techsingularity.net, david@redhat.com Cc: shikemeng@huaweicloud.com Subject: [PATCH v2 2/8] mm/compaction: correct last_migrated_pfn update in compact_zone Date: Wed, 2 Aug 2023 17:37:35 +0800 Message-Id: <20230802093741.2333325-3-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230802093741.2333325-1-shikemeng@huaweicloud.com> References: <20230802093741.2333325-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAXzrFTs8lkvrtvPQ--.56352S4 X-Coremail-Antispam: 1UD129KBjvJXoW7CFyfAw1fGrWDCFWrZry7Wrg_yoW8CF48pa 4rC3Z7Kr4DWayUZF1Yq34kZw1Ykws3KF43JrZ8Jw18Ars5Ka4Iyw17K3WjvrW5XrnIy3sY vF4qgay7AanrZa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPSb4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUXwA2048vs2IY020Ec7CjxVAFwI0_Gr0_Xr1l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l 84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zV CS5cI20VAGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E 5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAV WUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY 1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI 0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7s RNVbyUUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: EFFB710000F X-Stat-Signature: sh4mh94bpfxnzsennr1fgy8behsz8h95 X-Rspam-User: X-HE-Tag: 1690940251-175978 X-HE-Meta: U2FsdGVkX19CkIlQk5/cJoOcK6A8SovPpoGQHG8uN0BjpAlQJI2XSbl12INLu/mwcoQXHBksLX32RUBH3MbXxvrZrSE3dXnejplWmyK1Hrnef1kMK2JhHke/xExmhHe/acVCYX8xcnev83LhRshkqX1D+hz/dehlXQd+erEIPMxZyup7ByAiRbzaDFRT8DvTfUhYYzPmjzhOYbXWz9Kx+Em2NznF8/kZH6r9ZIAodrwvtUltsj+yh0cbtadLDDtOkZSar3v/YljeqgJEd1OXBx16ugBpDgJbXa6WBbFxMkcZrpajEcJ5yf15lrM/Iy2/P0LCC9DKMuTL9GGBO7WqWqlH6uB7DwUZfcpzsWNmo+HH8hR2tO1fKa8XZCDICffnfQfWCzaHkbzGgZXBnmwnDDPT5uE2jjkt7A5dSx1opBzbCe3UkfJ9I9ClfMX+NQiCPhc6GOxLIYMQq6IZPzi63YUmpeX07jC1TDvJS/BCi/yueiQpKLKtvLCLLbC/SV/I5iREWweZyjoVGt1Qm1pIpkzuGIHSAj3i7Ealj/tS+zcQzuJpRHjEUItQ6QEpFw6e6N9FiXWs790H01Iif7EiDcTfNDkcy4rtLXP229Fr5ni3D5YuDVUbh+CTiwJdr2D07dJZqToQW4mWNHszFRorQUWaRTKRJVZjf2JTHO65k1FvBmbywGFwc7nVkpg7vjGYgWWv5YQdZ7qftKM6mZc56GE4NxDVV6wySdU2/u5GF5JFp8Qldf4nlBlOTCpWM/pXoECT1WVcl08ilXeFi328K1yVgduZ5wyXIWog3nVqDfwDY3KGkaqeqO3X0XTTlWlPv4sPk12J4XICQtaWrlPiJTOJApC74y8SS9uuAh1/F5iRHa75h9w9uEIPtpbFfqV/qLSoDo0AtQrYH5kDyCTQID3cDJcLM/AggyHD4Kza9p3WprEV5J70SdeYGhHlp9vz88lVOb9cSZ5GKTQNtyq 5GSMcVDq d0JVqkUoAKiaZyXl5V1tDJroWKugrmCDxJHpNVeeFZTO1wqF3NSJTue7VrNRWDWZK7s5ASpFAO+Y7mRDe2ZbaNr2dkX87nnOS7vLKKoG5qvQraLXvQVgcOw68qCLrhINXdxnoxWG/r6kzuDUAtk5PYb7/5ac3xeeUenaq/J7AjBclCvX5336bRCOTJO2FP73cic7HSjaF/9tQEFNRONnO36g0Jmi4nZC9X6ZbK91wC5OsKbKJ65kP2kviTu8Sga04gd3f5xS3UZdiaRSH0DCBxkoa+1JKyArXp4TsOfwJPNt4yA7JwuYFdP16xPs8tSII0q4W 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. To avoid that: 1. Miss a rescan with finish_pageblock set as last_migrate_pfn does not point to right pageblock and the migrate will not be in pageblock of last_migrate_pfn as it should be. 2. Wrongly issue flush by test cc->order block boundary with wrong last_migrate_pfn. Signed-off-by: Kemeng Shi Reviewed-by: Baolin Wang --- mm/compaction.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index a8cea916df9d..ec3a96b7afce 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2487,7 +2487,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 Wed Aug 2 09:37: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: 13337508 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 6D9E1EB64DD for ; Wed, 2 Aug 2023 01:37:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 687BB2800C8; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 628C2280111; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A236280110; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 3C0E22800C8 for ; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id EE59E140616 for ; Wed, 2 Aug 2023 01:37:34 +0000 (UTC) X-FDA: 81077452428.14.2A40940 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf14.hostedemail.com (Postfix) with ESMTP id 3F9F8100005 for ; Wed, 2 Aug 2023 01:37:31 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=none; dmarc=none; spf=none (imf14.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=1690940252; 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=zwMKyTqVJ8Zl9NHsNE8W26XxnXlDSfnIBeHIS7EYcBo=; b=0yZDTNcFjuBbNXJGgiipXxIdq/nZ8G8rSpV+yP09AVtoJvVb253xUWSo1kDgPWacolPHCg DnEBkOgwl3zMu6Zau/TJriCnPKXcb2jSDaCM0a24rs+A/o6rfsL3LVdIb4QgI5GrBBA6Qj iGS9r6fM+IhdvmVq2gH4cLqqqTOCI30= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; dmarc=none; spf=none (imf14.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=1690940252; a=rsa-sha256; cv=none; b=IyidIWtC2PjCCKWb+ZelnF7FN8kUOGggF6RoOLvTNSEJi/zixIWAl0bwVuJ8bR6tEPZ9H0 mA9sjHKcKGlEqjX/itGIQr1tXttZnHCBtyGApvhLrLpDSjTSeRTbQDLe+ZcwTB73U+DwOy 4ZcOzkgiQH3J++UDi6ZMvmZnbW714JM= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RFvjg3XrJz4f3pC1 for ; Wed, 2 Aug 2023 09:37:27 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAXzrFTs8lkvrtvPQ--.56352S6; Wed, 02 Aug 2023 09:37:27 +0800 (CST) From: Kemeng Shi To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, mgorman@techsingularity.net, david@redhat.com Cc: shikemeng@huaweicloud.com Subject: [PATCH v2 4/8] mm/compaction: correct comment of fast_find_migrateblock in isolate_migratepages Date: Wed, 2 Aug 2023 17:37:37 +0800 Message-Id: <20230802093741.2333325-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230802093741.2333325-1-shikemeng@huaweicloud.com> References: <20230802093741.2333325-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAXzrFTs8lkvrtvPQ--.56352S6 X-Coremail-Antispam: 1UD129KBjvJXoW7Cr1Duw4furW5Gw4UAr4fKrg_yoW8Gryfpr 1xC3Z2gF1UW3W5G3ZxtF1DZ3W5Kw4xWF13JrZrXw1xJrs8X3Z2v3srtF1Fqr90qFy3Aayq vF4DKFyfAa1DZFJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPY14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2048vs2IY02 0E87I2jVAFwI0_JF0E3s1l82xGYIkIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0 rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6x IIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xv wVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFc xC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_ Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2 IErcIFxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0pRvJPtU UUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 3F9F8100005 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: rphbmwmihppsswh4fr5jmc48afzje5c4 X-HE-Tag: 1690940251-795930 X-HE-Meta: U2FsdGVkX1/4fxY4sVG7p+XP9szypnBAH5QTAsvOsA7cTQ6auP8V2+PFOQT4Ei9eG/NVH9cSCioW0O9Jo68XONd0QSf8SjmoTO1z45y3qFSAUCj32QduOQ+qlAxqRoT2oXP7dtj/uaOQ3D4Rp4gRXLsSVgBh4VhL6xItCFAfu3toEpnMh3aLOQyMLFu+XaF+z1M27Q6+nWASZxMLS1IJBtnBv5a0RntpeLfVEvNJUp9ERTjH+hNdZS+SApr0RM0Y6+BF/zrWQitHv2sE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Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: After 90ed667c03fe5 ("Revert "Revert "mm/compaction: fix set skip in fast_find_migrateblock"""), we remove skip set in fast_find_migrateblock. Correct comment that fast_find_block is used to avoid isolation_suitable check for pageblock returned from fast_find_migrateblock because fast_find_migrateblock will mark found pageblock skipped. Instead, comment that fast_find_block is used to avoid a redundant check of fast found pageblock which is already checked skip flag inside fast_find_migrateblock. Signed-off-by: Kemeng Shi --- mm/compaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 984c17a5c8fd..5c9dc4049e8e 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1966,8 +1966,8 @@ static isolate_migrate_t isolate_migratepages(struct compact_control *cc) 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 + * fast_find_migrateblock will ignore pageblock skipped, so to avoid + * the isolation_suitable check below again, check whether the fast * search was successful. */ fast_find_block = low_pfn != cc->migrate_pfn && !cc->fast_search_fail; From patchwork Wed Aug 2 09:37:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13337510 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 19257C001DF for ; Wed, 2 Aug 2023 01:37:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB716280111; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E8E9F280110; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A219D280111; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 793DA280112 for ; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4892A1C9C05 for ; Wed, 2 Aug 2023 01:37:35 +0000 (UTC) X-FDA: 81077452470.11.33AB418 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf19.hostedemail.com (Postfix) with ESMTP id 7DD891A0016 for ; Wed, 2 Aug 2023 01:37:32 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; spf=none (imf19.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.56) 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=1690940253; 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=Bgf3L5+1beG8C64RCCnI2PAMOD4a+B0/f237uX2C7Xk=; b=WFA8vNiDl5KpGZbMI+SlZjwpkWdFljPskccdlM/FVnhlHIrCKKGGaOO/p2JPAooO7n3suM WYE066HFeQ4YL6VNGMrW7VdFxm8tCgaETzZPx+HZlql5MMnFF/UaCPArFt3vJ2Dzve++MM GOaH2PBfjSRhXhheXPn8SAL9o6JI8XA= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=none (imf19.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.56) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690940253; a=rsa-sha256; cv=none; b=18laJQ+Hu4kggNTbQzpp1EMNlG9KIpecLSBxhq4vvPW8Ybs9+tvqjTa4PsY6gYVShKLtAD 5DysBMFBcyDY59A5IUXo6V/unTsZclmuNx8s9uCfD9yNwrMzrcIEUNEOpEtHJfoG5PsiQl L9PBLhSMVbAFLjM415E339oB2lqwHCs= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4RFvjd4Ftxz4f4K1T for ; Wed, 2 Aug 2023 09:37:25 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAXzrFTs8lkvrtvPQ--.56352S7; Wed, 02 Aug 2023 09:37:28 +0800 (CST) From: Kemeng Shi To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, mgorman@techsingularity.net, david@redhat.com Cc: shikemeng@huaweicloud.com Subject: [PATCH v2 5/8] mm/compaction: correct comment of cached migrate pfn update Date: Wed, 2 Aug 2023 17:37:38 +0800 Message-Id: <20230802093741.2333325-6-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230802093741.2333325-1-shikemeng@huaweicloud.com> References: <20230802093741.2333325-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAXzrFTs8lkvrtvPQ--.56352S7 X-Coremail-Antispam: 1UD129KBjvJXoW7tr1Duw4UKF45WFWktFWDArb_yoW8Jw13pr 97Cw1jqw4vqa13Kas2yr1kZa18Jr4ftFy3trsrK348AF43K3ZrtF9rtFyUZFW5X3sIvrWa vF47KFW7ta1fZaUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPF14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2048vs2IY02 0E87I2jVAFwI0_JF0E3s1l82xGYIkIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0 rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6x IIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xv wVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFc xC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_ Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2 IErcIFxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Cr0_Gr1UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJV W8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjTRKfOw UUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 7DD891A0016 X-Rspam-User: X-Stat-Signature: qefwwxen68gt87g4jrsrtaydw5ac9tof X-Rspamd-Server: rspam01 X-HE-Tag: 1690940252-692797 X-HE-Meta: U2FsdGVkX1997ScQlMgvVuYZi7CvI2bOFgUPOlXSmtOzZEIRnbE3AJWHqTNyoL75N9glzITpi8WkLhHYDcH4Onv7mS8ljDolsjqTOqtIhVvD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qwxkpZpPki0UF4r16PIIWfQAKO5Syc5yNY9SEk8HrC73oJNky4YewyPaKKMpMtprQbm/S2Ok5n7clwOuREi24aaHs0MJiN6dOC5mAXU2L92NwA1q+GfDUlSjyvULkLWLtg== 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 5c9dc4049e8e..7f01fbeb3084 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -469,6 +469,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 && @@ -490,7 +491,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 Wed Aug 2 09:37:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13337511 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 95D7CEB64DD for ; Wed, 2 Aug 2023 01:37:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 25D73280110; Tue, 1 Aug 2023 21:37:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C3BE280114; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA80C280112; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 80F13280113 for ; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4F2A04069D for ; Wed, 2 Aug 2023 01:37:35 +0000 (UTC) X-FDA: 81077452470.10.36FE192 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf04.hostedemail.com (Postfix) with ESMTP id 104C74000C for ; Wed, 2 Aug 2023 01:37:32 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690940253; 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=ojMDeLWoj1XODyjeyi7n+gkeOl0JR/suB/pw9H0+pdg=; b=tNIQecKQvcoP04nR/ekfHPuHil1FmqEtlhmBrnogTbg1nVsS5YgYQ/EIFGJ1YW9WoJ4jdV DzkPtXx/KweSfuE0D0jcYK0Zw6a2BwuuzmWBpOE8SNXKi2rYd0+ISdqaAOKXgxLUHw6fxa Ryxpo7zgfCFWpwIJ84MocIKMOYqw/PY= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690940253; a=rsa-sha256; cv=none; b=AJMnjWIOKH4rfO/zTSlzKvPtb54G1hyuyfbL3jGwE9TPKqp8UQ0ZVuQ7QSBV2gY54LQUHm qbE4FMyP5x0bR1TllKGe1SNLoFfz+RHiwAzhEavqfhpprVphtp1E5J2HngoV+b0VtY/2sr 91/On+thirFpwm8jHo0hfn5emULNkyE= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RFvjg4r0kz4f3nTt for ; Wed, 2 Aug 2023 09:37:27 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAXzrFTs8lkvrtvPQ--.56352S8; Wed, 02 Aug 2023 09:37:28 +0800 (CST) From: Kemeng Shi To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, mgorman@techsingularity.net, david@redhat.com Cc: shikemeng@huaweicloud.com Subject: [PATCH v2 6/8] mm/compaction: correct comment to complete migration failure Date: Wed, 2 Aug 2023 17:37:39 +0800 Message-Id: <20230802093741.2333325-7-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230802093741.2333325-1-shikemeng@huaweicloud.com> References: <20230802093741.2333325-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAXzrFTs8lkvrtvPQ--.56352S8 X-Coremail-Antispam: 1UD129KBjvdXoWrZF1UKrW8Kr48JrWrWrW3Wrg_yoWfWFX_Jr 4Iyr1rWw1F9r9IyanrCayayryagr4kZr17Ww1DX3y7t34vyF4fW3WDArsrZr9YqayDW3sx C34kZr1jk3Za9jkaLaAF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GoDUq5PAVdI5oFV8zCBalGToMsYWXk+JGrNe7lGjdQhW6ZZ9GjSQV7Wm3x/UBVnBH7mSJ946xaXweI+K1h3N67IlYKcMl5YnIQGefqzegthEWcoPWjggnbFEEVPZ0ac39OMVWofHmQPWUazO8hPUp7vfqrq35wQfwsKgzQNyXG+r21iTvLPYw9z0c6BVORBxqVqeYpMH/r0A5OfOIs67+GysaCFM51X3mJVQkNpIIImMnIdxUgl3IhxF93+b6GOODqqD 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 7f01fbeb3084..5581e4cccac5 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2512,7 +2512,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 Wed Aug 2 09:37:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13337512 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 1887CEB64DD for ; Wed, 2 Aug 2023 01:37:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5685F280113; Tue, 1 Aug 2023 21:37:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4866E280112; Tue, 1 Aug 2023 21:37:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1AB5280113; Tue, 1 Aug 2023 21:37:35 -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 96ED2280110 for ; Tue, 1 Aug 2023 21:37:35 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6B82AB2605 for ; Wed, 2 Aug 2023 01:37:35 +0000 (UTC) X-FDA: 81077452470.10.C703377 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf16.hostedemail.com (Postfix) with ESMTP id 3341518000A for ; Wed, 2 Aug 2023 01:37:32 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=none; spf=none (imf16.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=1690940253; 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=E8Ghhfo476pomQiMg5Ny4FSukhbg2Nff++sDyzBNwac=; b=0Xikjltoy/rrX4g5NahV2Mn/+mTonyxO9SIUjGQOQ12Wq9BpXGcJYkuFt9/VTLyUSHao/Y L8JY+W8iJxQZuVKL4ijV8QJ8IBkWryn39KZbHeHdWNMG/Qh+16vL0vAp3umS/zufLYcNke G88NoOeP4HfI60vTiOoujPl94Cm4NZk= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=none; spf=none (imf16.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=1690940253; a=rsa-sha256; cv=none; b=YCC/e672Vv6ftL3EiIsa6MDbaI14PvBIcQ8tPMOjoJKe8CYDbX8LBO8tP/NpfiBfghTaUd 7i09IN71UEJAPWC5npuvr5GYwfeGwRLEtNu26UWrb7oKptcIqYhSdYEb0sAGklqAUfhSg6 CN7G+pq6DxBMkJNWIPZX9MO6SXe2mDw= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4RFvjf5HZLz4f3jMY for ; Wed, 2 Aug 2023 09:37:26 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAXzrFTs8lkvrtvPQ--.56352S10; Wed, 02 Aug 2023 09:37:29 +0800 (CST) From: Kemeng Shi To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, mgorman@techsingularity.net, david@redhat.com Cc: shikemeng@huaweicloud.com Subject: [PATCH v2 8/8] mm/compaction: only set skip flag if cc->no_set_skip_hint is false Date: Wed, 2 Aug 2023 17:37:41 +0800 Message-Id: <20230802093741.2333325-9-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230802093741.2333325-1-shikemeng@huaweicloud.com> References: <20230802093741.2333325-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAXzrFTs8lkvrtvPQ--.56352S10 X-Coremail-Antispam: 1UD129KBjvdXoWrtw4ktF1DJF1Utw1kKw43trb_yoW3trc_Jr 10yF4rtw1avr93AFn8Xw47Cr1kKrWDCrnrWF1kXr4ay3yqya1vq3WDXrnrXw15XFW7ur9x GaykZF48GFya9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AK xVWxJVW8Jr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0pRvJPtU UUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 3341518000A X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: h6zbcdcmp6oizzay4izh57qtxrtbnf6u X-HE-Tag: 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4Xujrul1BIuXWsFtwaF2c1zn3L9ZL1Lph25gs+fiEnnZJ1YZNeumPJrCgCTBE0oRa2kxiPrperUmne0ok423DMeCQK6wnY4ECA7WliCWKaq+01ihC0ZpmVk79lxGKZ+OfJEFgKxf0dGE3aFS7DXgj8VeP4HQyflgPoUEdv6O7JqIa8jLq0WXLmY9zy9zsp3u5htFL6GLCE3kwAnncIu0kvU391gqcePfqTf8sduC6tOoVQYPiNznEWAiMb3ZcN5o/S2B1wh1mdCVNAg8aWA== 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 a1cc327d1b32..afc31d27f1ba 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1421,7 +1421,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); }