Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4762731rwb; Tue, 8 Aug 2023 13:29:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJF8e2Ztg7TNjoNwD1M12dINLJc0KctkT3q3WKjT4mZYq+AvN7fGcQmGnCCj0CZWc1G1dv X-Received: by 2002:a2e:b358:0:b0:2b7:b9ca:3eda with SMTP id q24-20020a2eb358000000b002b7b9ca3edamr433891lja.34.1691526551170; Tue, 08 Aug 2023 13:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691526551; cv=none; d=google.com; s=arc-20160816; b=HYaBP0J7VjMmtTvsbwa/LyY0omPhk8EEeP0hzunNz5lLU/Ih1y3qvBKdSLd8UbtXEo JfTpHmGEvPV4Mz09uC+cnn4G/9ED4aGbnbkRD3VSj8mH4X509rS1ssuqgId6CmNDRHPj rFiTq8mT/+eV4OFzA/AjzK7sUag0b7L0RAom1tewU+pGtHjMEkhB7pyEAYLRYUFgOiaG Q7BA3H2B4VKuZK4HZ+5P2QEBTTwf8/9EWpxSFSaoMud3117THOy1eeZUf/+dDsy0x4d3 1OnJFU5YJryEPvy6GRy8yu/0mYMrUWi6FZ6KRxw1tLhoQVlW+jWon6NVC4ITN7LhRDjP Orfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=jfpcFVTKvCfSqgpcf+hqzIL7zEbYUPV4Whjr34bFfwk=; fh=CCb/zWk5iSR1Cezn4T22zRVNiTtAAMtmnES4k8XuieA=; b=At2klQxDgjBvJxzsCFU97k6aXEKIwqnVNK784d+J4GAozC6hd06F62f3Q0lNmL/jim Fgjs+JWEA8QZTwOhpgTxFZllPsBD6dfMvX0Y+1R/r35t/RBPVzwxNzF2xNVuFjAgF0XD 2tiHK+ht+vhLMRWa7fQaMnxQafRUMjY2fW3N1AzkHTHlHs7I6VeRH8hNUHzlFFz9LJGn /H/PolaA407K0I0oLpxNIVklOcxTfL8eUWJAVmhg5b1yD6hgepaqsLCuMybdyIitEqKt Bhv7sozVyIH1Bo40UPbZHiig1f2mjRImyJcLmnHZQIPOIlph3FPXNkXDV2flTfto6R/o RrHw== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bw16-20020a170906c1d000b0099ba3bc37a9si8726695ejb.377.2023.08.08.13.28.44; Tue, 08 Aug 2023 13:29:11 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233641AbjHHS7T (ORCPT + 99 others); Tue, 8 Aug 2023 14:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231871AbjHHS7A (ORCPT ); Tue, 8 Aug 2023 14:59:00 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67427772B9 for ; Tue, 8 Aug 2023 10:20:52 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RKsvH4YFSz1hwFq; Tue, 8 Aug 2023 20:29:31 +0800 (CST) Received: from [10.174.151.185] (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 8 Aug 2023 20:32:20 +0800 Subject: Re: [PATCH] mm/page_alloc: remove unneeded current_order check To: Hugo Villeneuve CC: , , References: <20230808020555.658430-1-linmiaohe@huawei.com> <20230808081651.0d8573551f87de016c018529@hugovil.com> From: Miaohe Lin Message-ID: <3d0a7207-c46c-a183-65aa-7429e39b4f1c@huawei.com> Date: Tue, 8 Aug 2023 20:32:19 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20230808081651.0d8573551f87de016c018529@hugovil.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/8/8 20:16, Hugo Villeneuve wrote: > On Tue, 8 Aug 2023 10:05:55 +0800 > Miaohe Lin wrote: > >> current_order is guaranteed to '>=' min_order while min_order always '>=' >> order. So current_order must be '>=' order. >> >> Signed-off-by: Miaohe Lin >> --- >> mm/page_alloc.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >> index 96b7c1a7d1f2..d37ec87515d0 100644 >> --- a/mm/page_alloc.c >> +++ b/mm/page_alloc.c >> @@ -2072,8 +2072,7 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype, >> * allocation falls back into a different pageblock than this >> * one, it won't cause permanent fragmentation. >> */ >> - if (!can_steal && start_migratetype == MIGRATE_MOVABLE >> - && current_order > order) >> + if (!can_steal && start_migratetype == MIGRATE_MOVABLE) >> goto find_smallest; > > Hi, > if my analysis is correct, min_order can be initialized to the value of > order before the loop begins. > > In that case, in the last loop iteration, current_order will be > equal to min_order and also to order. The condition 'current_order > > order' will evaluate to false, and the 'if' block should not be > executed? Oh, that's my mistake. Thanks for pointing this out. Will drop this patch. Thanks!