mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] kernfs: switch global locks to per-fs lock
@ 2025-04-15 15:36 alexjlzheng
  2025-04-15 15:36 ` [PATCH v2 1/2] kernfs: switch global kernfs_idr_lock " alexjlzheng
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: alexjlzheng @ 2025-04-15 15:36 UTC (permalink / raw)
  To: gregkh, tj; +Cc: linux-kernel, Jinliang Zheng

From: Jinliang Zheng <alexjlzheng@tencent.com>

The kernfs implementation has big lock granularity so every kernfs-based
(e.g., sysfs, cgroup) fs are able to compete the locks. This patchset
switches the global locks to per-fs locks.

In fact, the implementation of global locks has not yet introduced
performance issues. But in the long run, more and more file systems will
be implemented based on the kernfs framework, so this optimization is
meaningful.

There are three global locks now, kernfs_idr_lock, kernfs_rename_lock
and kernfs_pr_cont_lock. We only switch kernfs_idr_lock and
kernfs_rename_lock here, because kernfs_pr_cont_lock is on a cold path.

Changelog:
v2: Only switch kernfs_idr_lock and kernfs_rename_lock to per-fs
v1: https://lore.kernel.org/all/20250411183109.6334-1-alexjlzheng@tencent.com/

Jinliang Zheng (2):
  kernfs: switch global kernfs_idr_lock to per-fs lock
  kernfs: switch global kernfs_rename_lock to per-fs lock

 fs/kernfs/dir.c             | 28 +++++++++++++++-------------
 fs/kernfs/kernfs-internal.h | 16 ++++++++++++----
 2 files changed, 27 insertions(+), 17 deletions(-)

-- 
2.49.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-21  6:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-15 15:36 [PATCH v2 0/2] kernfs: switch global locks to per-fs lock alexjlzheng
2025-04-15 15:36 ` [PATCH v2 1/2] kernfs: switch global kernfs_idr_lock " alexjlzheng
2025-04-15 15:36 ` [PATCH v2 2/2] kernfs: switch global kernfs_rename_lock " alexjlzheng
2025-04-20 15:02 ` [PATCH v2 0/2] kernfs: switch global locks " Jinliang Zheng
2025-04-21  6:07   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®