Re: [PATCH v2] mm/sparse: simplify the vmemmap alignment check
From: David Hildenbrand (Arm)
Date: Thu Oct 29 2026 - 11:47:49 EST
On 10/29/26 15:44, Kiryl Shutsemau wrote:
> On Thu, Oct 29, 2026 at 09:45:21PM +0800, Kaitao Cheng wrote:
>> From: Kaitao Cheng <chengkaitao@xxxxxxxxxx>
>>
>> sparse_init() is called only once during boot, and the vmemmap alignment
>> check is outside any loop, so VM_WARN_ON_ONCE() provides no benefit over
>> VM_WARN_ON() here.
>
> Okay, that's true. But who cares. __init section will be freed anyway.
> I don't see downside in current code.
>
>> Use VM_WARN_ON() and fold compound_info_has_mask() into its condition,
>> preserving short-circuit evaluation.
>
> Why? It only got harder to read, no?
This would be fine as part of some bigger rework, but standalone this cleanup is
not very attractive :)
--
Cheers,
David