Message ID | 20230805110711.2975149-10-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp259689vqr; Fri, 4 Aug 2023 21:24:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNm4u6bGiUVjwG2H3xZBIzkNG8ZZ3PvjXVZE9rGPWzMdyPwPOdijcH5TTW28983NB5O1c4 X-Received: by 2002:a05:6a20:4418:b0:13e:43df:d043 with SMTP id ce24-20020a056a20441800b0013e43dfd043mr4811212pzb.9.1691209496662; Fri, 04 Aug 2023 21:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691209496; cv=none; d=google.com; s=arc-20160816; b=yRIaIdp3NpuGd+9IsIj/fB7Um1cizoiUu1p4p+cXm4GBJgV7+taao18pWXAEyVVYSU KElhS+h4vNe64nZdH126pBUbW1VxFHJWrzYxQHKODNRN9yZHrGt6SLmPHW9C1PoIAWrX Od2jZD4u1FSmfaByCahGrjYK5Sk3cUqQOm4C5PdgnL2ZrOqQPrDimTY9Qj9yC57bOok9 0tmn9+Fcht6HQs/PKZNyhnp55ZrGygyWiI11I9a00WH3/cRkb/aMukdB6mMoX0HtJMTP eIVGf3TRGEW2Rmrfi5tZ4IfFk1kQMue+pVZO/fzJ3Nym8hRe3qZFj8xKwyFosES/21mT mUsQ== 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=KLsFy+v4yVmbzWqz2R32IBuN6RqkZlHIng/lQs9O/Vk=; fh=zpCCF/J8Z0sUUNZfCNdnaRvm94yhXPVxl9PzV22VU6k=; b=SGCMb/c1zAyFCzZ9kOOfeGSrCyNxx564zBmX4V+7BeYvo8aq8fcWQU5QiMj91YrkHJ MRILEnbb4seTZ5O46RawhHcDekedh6cAd3Buxieh+dX1auSo6kMW+J5SUf0Mae+rowlE K3l+brJnYEDunIybeAQ6eCceXrRguy6BzbcTAC90CQ7W45I0ZBIRCMWZFaIUWOP9/xqT MhrtSBcC4H69iWodsJ0Y236DjIEVwHwor8AmnDaaBs0QJgJTlyROKyqqcKtma1TOCLGJ uyeUsTUXhNqe8oeg5G37CI0GiA/4O6pMLoYoGvc2nCsE1DOGZkDtO9hn5/yP3M8we8PH tUeA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x14-20020a63484e000000b0053fb85dd81asi2603248pgk.325.2023.08.04.21.24.38; Fri, 04 Aug 2023 21:24:56 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229804AbjHEDHr (ORCPT <rfc822;liqunnana@gmail.com> + 99 others); Fri, 4 Aug 2023 23:07:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229661AbjHEDHI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 4 Aug 2023 23:07:08 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47EF64EE1 for <linux-kernel@vger.kernel.org>; Fri, 4 Aug 2023 20:07:04 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RHnYd0h4Gz4f3kjg for <linux-kernel@vger.kernel.org>; Sat, 5 Aug 2023 11:07:01 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAHvrHQvM1k6A5ePg--.23962S11; Sat, 05 Aug 2023 11:07:01 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> 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 9/9] mm/compaction: call compaction_suit_allocation_order in kcompactd_do_work Date: Sat, 5 Aug 2023 19:07:11 +0800 Message-Id: <20230805110711.2975149-10-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230805110711.2975149-1-shikemeng@huaweicloud.com> References: <20230805110711.2975149-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgAHvrHQvM1k6A5ePg--.23962S11 X-Coremail-Antispam: 1UD129KBjvdXoWrtFWrKr47ur4UAw17tFW8Zwb_yoWfXrc_Jr 1xAF4YvrWayrykWr4qkr4SyrW8Gw48Ar1DJwn0qF42yF9Fy39avw4DZFy7Zr15WFyDCr9x ua1rXa4DK3W29jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AK xVWxJVW8Jr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0pRvJPtU UUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773361689472716055 X-GMAIL-MSGID: 1773361689472716055 |
Series |
Fixes and cleanups to compaction
|
|
Commit Message
Kemeng Shi
Aug. 5, 2023, 11:07 a.m. UTC
Use compaction_suit_allocation_order helper in kcompactd_do_work to remove
repeat code.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
mm/compaction.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/mm/compaction.c b/mm/compaction.c index f4b6c520038a..05c27a1ef68a 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2963,12 +2963,8 @@ static void kcompactd_do_work(pg_data_t *pgdat) if (compaction_deferred(zone, cc.order)) continue; - /* Allocation can already succeed, nothing to do */ - if (zone_watermark_ok(zone, cc.order, - min_wmark_pages(zone), zoneid, 0)) - continue; - - if (!compaction_suitable(zone, cc.order, zoneid)) + if (compaction_suit_allocation_order(zone, + cc.order, zoneid, 0) != COMPACT_CONTINUE) continue; if (kthread_should_stop())