Re: [PATCH] configfs: wait for pending RCU callbacks on module exit
From: Yuichiro Goto
Date: Sun Nov 15 2026 - 18:24:31 EST
Hi Breno,
On Fri, Nov 13, 2026 at 8:33 PM Breno Leitao <leitao@xxxxxxxxxx> wrote:
> Is this still the case on mainline? Since commit 3bc999d944b3 ("mm/slab:
> introduce kfree_rcu_nolock()") in v7.3, kmem_cache_destroy() calls
> rcu_barrier() unconditionally, and configfs_exit() already reaches it:
>
> configfs_exit()
> kmem_cache_destroy(configfs_dir_cachep)
> kvfree_rcu_barrier_on_cache()
> rcu_barrier()
>
> so the pending configfs_free_inode() calls finish before configfs_exit()
> returns.
You are right, thanks for pointing it out. I reproduced the oops on
v6.18.63, which does not have 3bc999d944b3. With that commit,
configfs_exit() already waits for the pending callbacks in
kmem_cache_destroy(), and I confirmed that v7.3-rc2 with
CONFIG_RCU_LAZY=y no longer oopses with the same commands.
So please drop this patch for mainline.
3bc999d944b3 is not a fix and is unlikely to be backported, so the
stable trees that contain e9c03af21cc7 are still affected. I would like
to send the explicit rcu_barrier() to stable instead, referring to
3bc999d944b3 as the upstream equivalent. Does that sound reasonable?
Kind regards,
Yuichiro Goto