Re: [PATCH 1/1] mm: vmalloc: Optimize vmap_lazy_nr arithmetic when purging each vmap_area

From: Uladzislau Rezki
Date: Mon Sep 02 2024 - 13:03:14 EST


Hello!

>
> Hi,
>
> unrelated to your use case, but something that coud easily save a few cycles
> on some system, IMHO.
>
> Maybe:
>
> #if NR_CPUS > 1
> static __read_mostly unsigned int nr_vmap_nodes = 1;
> static __read_mostly unsigned int vmap_zone_size = 1;
> #else
> #define nr_vmap_nodes 1
> #define vmap_zone_size 1
> #endif
>
> So that the compiler can do a better job because some loops can be optimized
> away and there is no need to access some memory to get theses values.
>
> Not sure if such a use case can exist or is of any interest.
>
> This is valide because of [1] and the #ifdef around the num_possible_cpus()
> declaration [2, 3].
>
>
> Just my 2c.
>
Thank you, i see your point.

--
Uladzislau Rezki