diff options
| author | Imran Khan <[email protected]> | 2023-03-09 11:09:31 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2023-03-29 10:23:45 +0000 |
| commit | c9f2dfb7b59e5a6db054f821a6e1a6db8fa57d64 (patch) | |
| tree | 05c655fea0c99066e83b7593479ccbc6d9e10389 /fs/kernfs/kernfs-internal.h | |
| parent | kernfs: Introduce separate rwsem to protect inode attributes. (diff) | |
| download | kernel-c9f2dfb7b59e5a6db054f821a6e1a6db8fa57d64.tar.gz kernel-c9f2dfb7b59e5a6db054f821a6e1a6db8fa57d64.zip | |
kernfs: Use a per-fs rwsem to protect per-fs list of kernfs_super_info.
Right now per-fs kernfs_rwsem protects list of kernfs_super_info instances
for a kernfs_root. Since kernfs_rwsem is used to synchronize several other
operations across kernfs and since most of these operations don't impact
kernfs_super_info, we can use a separate per-fs rwsem to synchronize access
to list of kernfs_super_info.
This helps in reducing contention around kernfs_rwsem and also allows
operations that change/access list of kernfs_super_info to proceed without
contending for kernfs_rwsem.
Signed-off-by: Imran Khan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'fs/kernfs/kernfs-internal.h')
| -rw-r--r-- | fs/kernfs/kernfs-internal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h index 3297093c920d..a9b854cdfdb5 100644 --- a/fs/kernfs/kernfs-internal.h +++ b/fs/kernfs/kernfs-internal.h @@ -48,6 +48,7 @@ struct kernfs_root { wait_queue_head_t deactivate_waitq; struct rw_semaphore kernfs_rwsem; struct rw_semaphore kernfs_iattr_rwsem; + struct rw_semaphore kernfs_supers_rwsem; }; /* +1 to avoid triggering overflow warning when negating it */ |
