Re: [PATCH] vfs: remove SLAB_MEM_SPREAD flag usage

From: Chengming Zhou
Date: Mon Feb 26 2024 - 04:37:50 EST


On 2024/2/24 21:53, chengming.zhou@xxxxxxxxx wrote:
> From: Chengming Zhou <zhouchengming@xxxxxxxxxxxxx>
>
> The SLAB_MEM_SPREAD flag is already a no-op as of 6.8-rc1, remove
> its usage so we can delete it from slab. No functional change.

Update changelog to make it clearer:

The SLAB_MEM_SPREAD flag used to be implemented in SLAB, which was
removed as of v6.8-rc1, so it became a dead flag since the commit
16a1d968358a ("mm/slab: remove mm/slab.c and slab_def.h"). And the
series[1] went on to mark it obsolete explicitly to avoid confusion
for users. Here we can just remove all its users, which has no any
functional change.

[1] https://lore.kernel.org/all/20240223-slab-cleanup-flags-v2-1-02f1753e8303@xxxxxxx/

Thanks!

>
> Signed-off-by: Chengming Zhou <zhouchengming@xxxxxxxxxxxxx>
> ---
> fs/buffer.c | 2 +-
> fs/dcache.c | 2 +-
> fs/inode.c | 2 +-
> fs/mbcache.c | 3 +--
> 4 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/fs/buffer.c b/fs/buffer.c
> index b55dea034a5d..9a54077de87d 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -3122,7 +3122,7 @@ void __init buffer_init(void)
> int ret;
>
> bh_cachep = KMEM_CACHE(buffer_head,
> - SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);
> + SLAB_RECLAIM_ACCOUNT|SLAB_PANIC);
> /*
> * Limit the bh occupancy to 10% of ZONE_NORMAL
> */
> diff --git a/fs/dcache.c b/fs/dcache.c
> index 6ebccba33336..71a8e943a0fa 100644
> --- a/fs/dcache.c
> +++ b/fs/dcache.c
> @@ -3139,7 +3139,7 @@ static void __init dcache_init(void)
> * of the dcache.
> */
> dentry_cache = KMEM_CACHE_USERCOPY(dentry,
> - SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD|SLAB_ACCOUNT,
> + SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_ACCOUNT,
> d_iname);
>
> /* Hash may have been set up in dcache_init_early */
> diff --git a/fs/inode.c b/fs/inode.c
> index 6d0d54230363..d2e8e3884b36 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2286,7 +2286,7 @@ void __init inode_init(void)
> sizeof(struct inode),
> 0,
> (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
> - SLAB_MEM_SPREAD|SLAB_ACCOUNT),
> + SLAB_ACCOUNT),
> init_once);
>
> /* Hash may have been set up in inode_init_early */
> diff --git a/fs/mbcache.c b/fs/mbcache.c
> index fe2624e17253..e60a840999aa 100644
> --- a/fs/mbcache.c
> +++ b/fs/mbcache.c
> @@ -426,8 +426,7 @@ EXPORT_SYMBOL(mb_cache_destroy);
>
> static int __init mbcache_init(void)
> {
> - mb_entry_cache = KMEM_CACHE(mb_cache_entry,
> - SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD);
> + mb_entry_cache = KMEM_CACHE(mb_cache_entry, SLAB_RECLAIM_ACCOUNT);
> if (!mb_entry_cache)
> return -ENOMEM;
> return 0;