From patchwork Thu Jul 20 11:53:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13319738 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 8F121C0015E for ; Thu, 20 Jul 2023 03:53:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 213DB2800AC; Wed, 19 Jul 2023 23:53:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C3E828004C; Wed, 19 Jul 2023 23:53:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9EC92800AD; Wed, 19 Jul 2023 23:53:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id CF46428004C for ; Wed, 19 Jul 2023 23:53:28 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9B44712010C for ; Thu, 20 Jul 2023 03:53:28 +0000 (UTC) X-FDA: 81030620496.07.5F8E5F4 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf13.hostedemail.com (Postfix) with ESMTP id 2510A2000A for ; Thu, 20 Jul 2023 03:53:25 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=none; spf=none (imf13.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=1689825206; a=rsa-sha256; cv=none; b=2dleanxKDZaFST0LHRW6SF1LLiQOQI/uzOPw1hGw566EwgG0A5XfcaXldHfjeQXzGA4aXU RALVef7Fm9fZcX/lUJ6TMpI3ak2XH+03Bx6SKLR3Ni4kXNs/MTEnIQs/AtbIWEiuqFmNDg 6HJhCgpgbhLzT3nciksGVK65ag/pynY= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=none; spf=none (imf13.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=1689825206; 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=WVMmoiJzELriBw3CsenVp/obquKL0A8EdlDn3IZr+M0=; b=G3DXCgQKWdSunKrq6vQ8nv6udfxIZ4kBM0eGEaxRyuSZ9RqjU6TOnRdwdsF4axu6qPi462 0Qn4gnzdnB0MkIx5gR1+6U1yGBStaLZ+2+yCql18u6NfZb5n9JX8rv5QH/7ztjEyOEjCa9 MtHwj6pC4TkUnk718TNp2zNnc8qSbsw= Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4R5zLR1mylz4f400b for ; Thu, 20 Jul 2023 11:53:19 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgC3q+mtr7hk4qk0OQ--.49914S5; Thu, 20 Jul 2023 11:53:19 +0800 (CST) From: Kemeng Shi To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: shikemeng@huaweicloud.com Subject: [PATCH 2/2] mm/compaction: avoid unneeded pageblock_end_pfn when no_set_skip_hint is set Date: Thu, 20 Jul 2023 19:53:51 +0800 Message-Id: <20230720115351.2039431-4-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230720115351.2039431-1-shikemeng@huaweicloud.com> References: <20230720115351.2039431-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgC3q+mtr7hk4qk0OQ--.49914S5 X-Coremail-Antispam: 1UD129KBjvdXoWruw4kWFykZFy7Wr4rCr4xCrg_yoWfJrgEqw 48trs0ywn0yF1vvrsrZw4ayrWjgFWDAF17K3WktrW2yF92y3Wvvw1DZw13urnxXa9rWwnx Ww1kZF1DGFya9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbqAYFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r1rM28IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6I AqYI8I648v4I1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAq x4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r 1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF 7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxV WUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjTR QSdDUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2510A2000A X-Stat-Signature: t9pio7ukam8sgw3qqrssyh5uwjps5b1w X-Rspam-User: X-HE-Tag: 1689825205-191128 X-HE-Meta: U2FsdGVkX18H7PE0AxF9sqWXJsA6hNAgVM4u2vxQBO0nX3MljXxJ1WK7+GvY8c97XoLSe1MwTdhqJ+3eY9nefxHBmdHG94DqVZlx2wsYC2IIjeNIsE02nHEc9aYWdUYMT9ghtD+ofqHaMO0T6B0rma0AdrUbU1sV3Xpddi1nwKxb3LiSlxmpJ+0cT+QDBsw35wUqtUycJV/fVwvaFXVy7WTfIJ+ZYwysy0HdRMLASiOEdFJj3+Y29wOGbH+wJ1W0RS6+Do2/p1SDx7lSxxFmRSkT1fPaYHB+4iLf5mUAOyL9NoyuY1ywstcgrpHa02GeUQGfMVGpChGElYhkb1n5kToVwrEvMfg6OWqtYYRg6wVGkzcDknsPc5zgt8XOoWiEfgEcncAV35UdoL5u9lpulzS6xh1uJ50mmRAlIgYpH+zvy20dHGt0OhNAy8DPv/Wyb+ifCOdFQbCTpjSCtqjxxBPJbHNHspGNHdCXxbCZPuTC6md83DxDqvl3v0D8xo44+eJarkF8qg0udg9hBrImeGWb3frHAQznKzaLw3m3c0UTxGuKgnQMMz0uz4dyv+CBxPVQQbY9C+OIceHYDgQHQ0qk+W/FqsHoCzxau8vCK9DNhM1UsNFOt3ypclLQpGV/mhgk/kK1b1iE2S+2cbl1pZQ4M5FeevPwPJLmEJiLbm2OkUU+EtEDnlEmKuhydKwxfngcMGAwKNux72TNB+kNI8G4eCOvabbATwZ8zxYRUZI6NOEPbS+ini93rdxtqYTnUWRvSHClRsEQb2i2F22oxY0t7V9R590DDKMLJHJc9Iz7cnbBOekjxY/BRS8AtNziOQ25BbmRIxO/p1y9tx3zkgMAx6R7T1RnR09fox2Tj3O2MErINxGWAwXJX3ioe2oMHaoK5hcevurtcb0r3pc7EmjbCM/5BbnA2dAseD1dSPicmfp/lFLW2KxIZ4gGNe6xl/QZH7kr6XjKWz8XoNF CnflCvs8 dSIIl4oaWtPqWawB4Q50ZheNMrFzOYxLDQcbK9X6rox0dlw7QkDGBHdxFeysXr3vAMr32qFjr+BqF+fMe1rYArimslGXj56Ipu2vHYfRm9jXpOIP3izQmT1fEJECuF9InyX3ggFTZfuUjqw2cWFi1/mTDV4ZOYRWz2RYKY5bWEjHU0tMXbsuDUXRBgYWgT4zdHp2s+CbkXFS6EYnSvwrmIQnDbT5uipzpBflzuDKuELloA2whmUY9HJU7fV0ybFJaGrKZPbWZRC93m6LU0O6PLUzR5VgFt3Mo8BYnEhBpbZITENPJucjjHNipGTh2D6PSoSBPX8eOP5hfCBgV26sLmKXM4g== 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: Move pageblock_end_pfn after no_set_skip_hint check to avoid unneeded pageblock_end_pfn if no_set_skip_hint is set. Signed-off-by: Kemeng Shi Reviewed-by: Baolin Wang --- mm/compaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index c0d8d08fc163..9b7a0a69e19f 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -458,12 +458,12 @@ static void update_cached_migrate(struct compact_control *cc, unsigned long pfn) { struct zone *zone = cc->zone; - pfn = pageblock_end_pfn(pfn); - /* Set for isolation rather than compaction */ if (cc->no_set_skip_hint) return; + pfn = pageblock_end_pfn(pfn); + if (pfn > zone->compact_cached_migrate_pfn[0]) zone->compact_cached_migrate_pfn[0] = pfn; if (cc->mode != MIGRATE_ASYNC &&