Re: [PATCH 1/5] mm/vmalloc.c: change purge_ndoes as local static variable

Vishal Moola (Oracle)
2025-04-15T23:53:34Z

On Tue, Apr 15, 2025 at 10:39:48AM +0800, Baoquan He wrote:
> Static variable 'purge_ndoes' is defined in global scope, while it's
> only used in function __purge_vmap_area_lazy(). It mainly serves to
> avoid memory allocation repeatedly, especially when NR_CPUS is big.
>
> While a local static variable can also satisfy the demand, and can
> improve code readibility. Hence move its definition into
> __purge_vmap_area_lazy().
>
> Signed-off-by: Baoquan He <bhe@redhat.com>

Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>