]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
kernfs: switch global kernfs_idr_lock to per-fs lock
authorJinliang Zheng <alexjlzheng@tencent.com>
Tue, 15 Apr 2025 15:36:58 +0000 (23:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 14:01:56 +0000 (16:01 +0200)
commitcec59c440a05c241846e8fe9d2575a2dafb56fd9
treea7216443f4c042074eac1b9fc98b3141b02a2c06
parent2806c6b8f3d1e406f2b7e3266ddd21100fbe7151
kernfs: switch global kernfs_idr_lock to per-fs lock

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@tencent.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20250415153659.14950-2-alexjlzheng@tencent.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/kernfs/dir.c
fs/kernfs/kernfs-internal.h