lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <758DA9C6-D4FD-4985-B6C2-B68CF9F4622F@nvidia.com>
Date: Tue, 26 Aug 2025 22:29:57 -0400
From: Zi Yan <ziy@...dia.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Brendan Jackman <jackmanb@...gle.com>, Vlastimil Babka <vbabka@...e.cz>,
 Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
 Johannes Weiner <hannes@...xchg.org>, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/page_alloc: Harmonize should_compact_retry() type

On 26 Aug 2025, at 22:13, 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?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ