diff options
author | Tim Murray <timmurray@google.com> | 2022-01-07 12:48:44 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-01-24 17:40:04 -0800 |
commit | e4544b63a7ee49e7fbebf35ece0a6acd3b9617ae (patch) | |
tree | b55709d5753a19b8beacfcab1fe12dc8128435d7 /fs/f2fs/verity.c | |
parent | dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0 (diff) |
f2fs: move f2fs to use reader-unfair rwsems
f2fs rw_semaphores work better if writers can starve readers,
especially for the checkpoint thread, because writers are strictly
more important than reader threads. This prevents significant priority
inversion between low-priority readers that blocked while trying to
acquire the read lock and a second acquisition of the write lock that
might be blocking high priority work.
Signed-off-by: Tim Murray <timmurray@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/verity.c')
-rw-r--r-- | fs/f2fs/verity.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c index fe5acdccaae1..3d793202cc9f 100644 --- a/fs/f2fs/verity.c +++ b/fs/f2fs/verity.c @@ -208,7 +208,7 @@ cleanup: * from re-instantiating cached pages we are truncating (since unlike * normal file accesses, garbage collection isn't limited by i_size). */ - down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]); + f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]); truncate_inode_pages(inode->i_mapping, inode->i_size); err2 = f2fs_truncate(inode); if (err2) { @@ -216,7 +216,7 @@ cleanup: err2); set_sbi_flag(sbi, SBI_NEED_FSCK); } - up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]); + f2fs_up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]); clear_inode_flag(inode, FI_VERITY_IN_PROGRESS); return err ?: err2; } |