Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4723062rwb; Tue, 8 Aug 2023 12:46:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmIq7c2yfOlJaNes5Up1ppvUgyuFyRO2AmUq8ZdOPX9ryd9VlSeA1r/qXjVhBIi5vxMZZC X-Received: by 2002:a05:6402:5203:b0:51d:cf7b:c9f0 with SMTP id s3-20020a056402520300b0051dcf7bc9f0mr13363688edd.12.1691523977489; Tue, 08 Aug 2023 12:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691523977; cv=none; d=google.com; s=arc-20160816; b=RyvxsYdVgM9syg9oAXULqixjjlwcqtHfsLxJCOkTf86LIoWE6GlTiUzO4daPQbwXDx Szf0h7i6VFvlN1AsFhPkDBwFQhVHlk5kCiCTMSTGdPlSFT8xN6ZUl4QQpy5PhKSfdeRt 1RdMYFkD9hJ8RBZgulv44AVAll/lx8ll1xfGTj3V7BuAbPOs2oH4ZJ39H+0Qjo+Z7V1y LygRVtAytAiBY3LGsjHroFgqedbJjxr46Q8mi1PBkCF8SKSfPjWse63hNLORPLlEGYLF xKY8pQthTJOI0mAIXwH2W5aUJUWTwCNPncYJ/5ndcQJZkm3QZ93h/4vAYLqilmLBovy0 GIOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:from:date:dkim-signature; bh=84aIMxuVFMuTd09rn/TyCy86mewE5GkRaaZb1AsVDgI=; fh=DGJ9rg9az+i0NInR52Fw4virdnYJf1uCf9b7tWo4meQ=; b=rOUUvFR7A7p1IokGDhan1PZvy8k23+NYDVUOXfMbNw6s85dNrRaYTOlxV2G5NKUxe7 5AfvRs2FbduwITXryOmNZD6XiQ+zp68P3q7ktzAh8TfStVyb9A8a2324VJaKJTUWYenu QSwtVQ0OdOeB8oY5vkMAGecFdFHAV7orAaclwL2gAZkhruO5cj0y15IgPkoO0NvhAoAU oiSS7TEbK/A8X0dT9O7yTlBzdPGhiZDHmpJPfgMy+Ow+Eo6zU6k6HXlDXU3mtr23OEkI hJelG0VbKV1CdJwmBcSkNrYBk4+9MJ+nzi2PEP/cvmbG1iG1kDbj2bDkILwg2dvVyf+b fnzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=vk+6fgxz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v22-20020aa7cd56000000b00523260d1951si6468868edw.248.2023.08.08.12.45.52; Tue, 08 Aug 2023 12:46:17 -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; dkim=pass header.i=@hugovil.com header.s=x header.b=vk+6fgxz; 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 S234591AbjHHRaY (ORCPT + 99 others); Tue, 8 Aug 2023 13:30:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234567AbjHHR3t (ORCPT ); Tue, 8 Aug 2023 13:29:49 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6541D8C0BB for ; Tue, 8 Aug 2023 09:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:Mime-Version:Message-Id:Cc:To:From :Date:subject:date:message-id:reply-to; bh=84aIMxuVFMuTd09rn/TyCy86mewE5GkRaaZb1AsVDgI=; b=vk+6fgxzWR2B1EmxvLOAFtvmir k75qjCf+u5+2qJJ7uQe/zZAZeeGWnR7LZRSxEbKRd43EKEl4gP3uYV/PaiPj4moYnNq/WPX56LK04 WimWRtOSS+aaXET2ulvLEnlpDb12Be/6V3tqI80xS52L3vktG2YDX6qqNxkC4mxvLhAk=; Received: from modemcable061.19-161-184.mc.videotron.ca ([184.161.19.61]:39724 helo=pettiford) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1qTLdr-000461-Oq; Tue, 08 Aug 2023 08:16:53 -0400 Date: Tue, 8 Aug 2023 08:16:51 -0400 From: Hugo Villeneuve To: Miaohe Lin Cc: , , Message-Id: <20230808081651.0d8573551f87de016c018529@hugovil.com> In-Reply-To: <20230808020555.658430-1-linmiaohe@huawei.com> References: <20230808020555.658430-1-linmiaohe@huawei.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 184.161.19.61 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Subject: Re: [PATCH] mm/page_alloc: remove unneeded current_order check X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Hugo.