From: Zi Yan <ziy@nvidia.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Brendan Jackman <jackmanb@google.com>,
Vlastimil Babka <vbabka@suse.cz>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/page_alloc: Harmonize should_compact_retry() type
Date: Tue, 26 Aug 2025 22:29:57 -0400 [thread overview]
Message-ID: <758DA9C6-D4FD-4985-B6C2-B68CF9F4622F@nvidia.com> (raw)
In-Reply-To: <20250826191320.d5aa551eb5abef316de41175@linux-foundation.org>
On 26 Aug 2025, at 22:13, Andrew Morton wrote:
> On Tue, 26 Aug 2025 14:06:54 +0000 Brendan Jackman <jackmanb@google.com> wrote:
>
>> Currently order is signed in one version of the function and unsigned in
>> the other. Tidy that up.
>>
>> In page_alloc.c, order is unsigned in the vast majority of cases. But,
>> there is a cluster of exceptions in compaction-related code (probably
>> stemming from the fact that compact_control.order is signed). So, prefer
>> local consistency and make this one signed too.
>>
>
> grumble, pet peeve. Negative orders make no sense. Can we make
> cc->order unsigned in order (heh) to make everything nice?
Unless we do not do order--, where order can go negative. See next_search_order()
in mm/compaction.c as an example.
>
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -4182,7 +4182,7 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
>> }
>>
>> static inline bool
>> -should_compact_retry(struct alloc_context *ac, unsigned int order, int alloc_flags,
>> +should_compact_retry(struct alloc_context *ac, int order, int alloc_flags,
>> enum compact_result compact_result,
>> enum compact_priority *compact_priority,
>> int *compaction_retries)
>>
--
Best Regards,
Yan, Zi
next prev parent reply other threads:[~2025-08-27 2:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 14:06 Brendan Jackman
2025-08-26 21:15 ` Zi Yan
2025-08-27 2:13 ` Andrew Morton
2025-08-27 2:29 ` Zi Yan [this message]
2025-08-27 15:30 ` Brendan Jackman
2025-08-28 18:31 ` Vlastimil Babka
2025-08-29 11:20 ` Brendan Jackman
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=758DA9C6-D4FD-4985-B6C2-B68CF9F4622F@nvidia.com \
--to=ziy@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
/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
all inboxes | Powered by JetHome®