lkml.org 
[lkml]   [2022]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 0/2] kernfs: use hashed mutex and spinlock in place of global ones
On Thu, Jan 13, 2022 at 09:42:57PM +1100, Imran Khan wrote:
> 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>)
>

I will look at this closer after the merge window is closed (can't do
anything until then), but do these changes actually solve your
contention problem? You don't say so here, so it's hard to tell.

thanks,

greg k-h

\
 
 \ /
  Last update: 2022-01-13 11:58    [W:0.103 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site