Re: [PATCH 1/5] mm/vmalloc.c: change purge_ndoes as local static variable
From: Vishal Moola (Oracle)
Date: Tue Apr 15 2025 - 19:53:49 EST
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@xxxxxxxxxx>
Reviewed-by: Vishal Moola (Oracle) <vishal.moola@xxxxxxxxx>