Re: [PATCH kernfs 1/3] kernfs: switch global kernfs_idr_lock to per-fs lock
From: Tejun Heo
Date: Mon Apr 14 2025 - 13:09:37 EST
On Sat, Apr 12, 2025 at 02:31:07AM +0800, alexjlzheng@xxxxxxxxx wrote:
> From: Jinliang Zheng <alexjlzheng@xxxxxxxxxxx>
>
> The kernfs implementation has big lock granularity(kernfs_idr_lock) so
> every kernfs-based(e.g., sysfs, cgroup) fs are able to compete the lock.
>
> This patch switches the global kernfs_idr_lock to per-fs lock, which
> put the spinlock into kernfs_root.
>
> Signed-off-by: Jinliang Zheng <alexjlzheng@xxxxxxxxxxx>
Given that it doesn't really make things any more complicated, I think this
makes more sense than the existing code even without any direct evidence
that this improves performance.
Acked-by: Tejun Heo <tj@xxxxxxxxxx>
Thanks.
--
tejun