Re: [PATCH v2 2/3] mm, slab: use an enum to define SLAB_ cache creation flags

From: David Rientjes
Date: Sat Feb 24 2024 - 16:02:22 EST


On Fri, 23 Feb 2024, Vlastimil Babka wrote:

> The values of SLAB_ cache creation flags are defined by hand, which is
> tedious and error-prone. Use an enum to assign the bit number and a
> __SLAB_FLAG_BIT() macro to #define the final flags.
>
> This renumbers the flag values, which is OK as they are only used
> internally.
>
> Also define a __SLAB_FLAG_UNUSED macro to assign value to flags disabled
> by their respective config options in a unified and sparse-friendly way.
>
> Reviewed-and-tested-by: Xiongwei Song <xiongwei.song@xxxxxxxxxxxxx>
> Reviewed-by: Chengming Zhou <chengming.zhou@xxxxxxxxx>
> Reviewed-by: Roman Gushchin <roman.gushchin@xxxxxxxxx>
> Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx>

Acked-by: David Rientjes <rientjes@xxxxxxxxxx>