Re: [PATCH 01/12] mm/sparse: move mem_section init to sparse_extreme_init()

From: David Hildenbrand (Arm)

Date: Thu Sep 10 2026 - 09:18:06 EST


On 9/10/26 14:52, Lorenzo Stoakes (ARM) wrote:
> On Wed, Sep 09, 2026 at 03:32:54PM +0200, David Hildenbrand (Arm) wrote:
>> Let's just avoid another pair of ifdef inside a function. While at it,
>> switch to INTERNODE_CACHE_BYTES by just defining a fallback in cache.h
>> as well, given that the x86 variant already provides one.
>>
>> Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
>
> Nic ecleanup, one nit below.
>
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
>
>> ---
>> include/linux/cache.h | 1 +
>> mm/sparse.c | 19 ++++++++++++-------
>> 2 files changed, 13 insertions(+), 7 deletions(-)
>>
>> diff --git a/include/linux/cache.h b/include/linux/cache.h
>> index e69768f50d532..b6e857b985bca 100644
>> --- a/include/linux/cache.h
>> +++ b/include/linux/cache.h
>> @@ -89,6 +89,7 @@
>> */
>> #ifndef INTERNODE_CACHE_SHIFT
>> #define INTERNODE_CACHE_SHIFT L1_CACHE_SHIFT
>> +#define INTERNODE_CACHE_BYTES (1 << INTERNODE_CACHE_SHIFT)
>
> NIT: 1UL?

I decided to replicate the existing

arch/x86/include/asm/cache.h:#define INTERNODE_CACHE_BYTES (1 << INTERNODE_CACHE_SHIFT)

If the shifted value would ever not fit into an int something would be
going really wrong ;)

Thanks!

--
Cheers,

David