lkml.org 
[lkml]   [2020]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] kernfs: replace the mutex in kernfs_iop_permission with a rwlock
On Wed, Dec 02, 2020 at 10:58:36PM +0800, Fox Chen wrote:
> diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
> index 89f6a4214a70..545cdb39b34b 100644
> --- a/include/linux/kernfs.h
> +++ b/include/linux/kernfs.h
> @@ -156,6 +156,7 @@ struct kernfs_node {
> unsigned short flags;
> umode_t mode;
> struct kernfs_iattrs *iattr;
> + rwlock_t iattr_rwlock;
> };

Also, while this might not look like much, kernfs_node is very size
sensitive. There are systems with huge number of these nodes, so I don't
think putting a per-node lock like this is a good idea. Either we can use a
shared iattr protecting lock or play some cmpxchg games when allocating and
setting ->iattr and put the lock there.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2020-12-02 19:39    [W:0.123 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site