All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imran Khan <imran.f.khan@oracle.com>
To: tj@kernel.org, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/2] kernfs: use hashed mutex and spinlock in place of global ones
Date: Thu, 13 Jan 2022 21:42:57 +1100	[thread overview]
Message-ID: <20220113104259.1584491-1-imran.f.khan@oracle.com> (raw)

Reduce contention around global locks used in kernfs.

PATCH-1: Make global kernfs_open_file_mutex and kernfs_open_node_lock
	 hashed locks, where address of a kernfs_node acts as hash key.
	 This results in kernfs_node objects, whose address give the
	 different hash value, using different kernfs_open_file_mutex
	 and kernfs_open_node_lock rather than all kernfs_node objects
	 using the same kernfs_open_file_mutex and kernfs_open_node_lock
	 as was the case earlier.

PATCH-2: Use a hashed rw_semaphore to access permissions, so that we can
	 avoid contention around global per-fs rw_semaphore, seen if
	 multiple applications are executing inode_permission and
	 walk_component in parallel when trying to open sysfs file(s).

------------------------------------------------------------------

Changes since v2:
 - Remove RFC tag
 - Use hashed locks rather than using per kernfs_node specific lock
   (Suggested by Tejun Heo <tj@kernel.org>)
   

Imran Khan (2):
  kernfs: use hashed mutex and spinlock in place of global ones.
  kernfs: Reduce contention around global per-fs kernfs_rwsem.

 fs/kernfs/dir.c             |  8 +++++
 fs/kernfs/file.c            | 65 ++++++++++++++++-----------------
 fs/kernfs/inode.c           | 35 ++++++++++++------
 fs/kernfs/kernfs-internal.h | 71 +++++++++++++++++++++++++++++++++++++
 fs/kernfs/mount.c           | 11 ++++++
 5 files changed, 146 insertions(+), 44 deletions(-)


base-commit: a70bf4a85b43cb952bd39dd948b103b1b3eb2cf8
-- 
2.30.2


             reply	other threads:[~2022-01-13 10:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13 10:42 Imran Khan [this message]
2022-01-13 10:42 ` [PATCH v3 1/2] kernfs: use hashed mutex and spinlock in place of global ones Imran Khan
2022-01-13 15:08   ` kernel test robot
2022-01-13 16:37   ` Tejun Heo
2022-01-17 18:54   ` kernel test robot
2022-01-13 10:42 ` [PATCH v3 2/2] kernfs: Reduce contention around global per-fs kernfs_rwsem Imran Khan
2022-01-13 10:58   ` Greg KH
2022-01-13 16:42   ` Tejun Heo
2022-01-14 17:08     ` Imran Khan
2022-01-14 17:44       ` Tejun Heo
2022-02-02 15:10     ` Imran Khan
2022-01-25  2:55   ` [kernfs] 8652224976: WARNING:at_kernel/locking/rwsem.c:#up_write kernel test robot
2022-01-25  2:55     ` kernel test robot
2022-01-13 10:57 ` [PATCH v3 0/2] kernfs: use hashed mutex and spinlock in place of global ones Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220113104259.1584491-1-imran.f.khan@oracle.com \
    --to=imran.f.khan@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.