[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DCDBG4WR1ZDF.23COVR1IO2OSJ@google.com>
Date: Wed, 27 Aug 2025 15:30:27 +0000
From: Brendan Jackman <jackmanb@...gle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Vlastimil Babka <vbabka@...e.cz>, Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
Johannes Weiner <hannes@...xchg.org>, Zi Yan <ziy@...dia.com>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm/page_alloc: Harmonize should_compact_retry() type
On Wed Aug 27, 2025 at 2:13 AM UTC, Andrew Morton wrote:
> On Tue, 26 Aug 2025 14:06:54 +0000 Brendan Jackman <jackmanb@...gle.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?
I think we can't "just" do that:
/*
* order == -1 is expected when compacting proactively via
* 1. /proc/sys/vm/compact_memory
* 2. /sys/devices/system/node/nodex/compact
* 3. /proc/sys/vm/compaction_proactiveness
*/
static inline bool is_via_compact_memory(int order)
{
return order == -1;
}
Powered by blists - more mailing lists