From: Miaohe Lin <linmiaohe@huawei.com>
To: Hugo Villeneuve <hugo@hugovil.com>
Cc: <akpm@linux-foundation.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/page_alloc: remove unneeded current_order check
Date: Tue, 8 Aug 2023 20:32:19 +0800 [thread overview]
Message-ID: <3d0a7207-c46c-a183-65aa-7429e39b4f1c@huawei.com> (raw)
In-Reply-To: <20230808081651.0d8573551f87de016c018529@hugovil.com>
On 2023/8/8 20:16, Hugo Villeneuve wrote:
> On Tue, 8 Aug 2023 10:05:55 +0800
> Miaohe Lin <linmiaohe@huawei.com> wrote:
>
>> current_order is guaranteed to '>=' min_order while min_order always '>='
>> order. So current_order must be '>=' order.
>>
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
>> ---
>> 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!
prev parent reply other threads:[~2023-08-08 12:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 2:05 Miaohe Lin
2023-08-08 12:16 ` Hugo Villeneuve
2023-08-08 12:32 ` Miaohe Lin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d0a7207-c46c-a183-65aa-7429e39b4f1c@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=hugo@hugovil.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox