summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-07-03 18:58:39 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2014-07-30 23:28:37 -0700
commitb3582c68920105e29d219714d8a6fbde25a43379 (patch)
tree200ab9ca194921c8baad9954fee36eee072a772f /fs/f2fs/node.c
parent65b85ccce03f17b3098273192b20885f3fead820 (diff)
downloadlinux-b3582c68920105e29d219714d8a6fbde25a43379.tar.bz2
f2fs: reduce competition among node page writes
We do not need to block on ->node_write among different node page writers e.g. fsync/flush, unless we have a node page writer from write_checkpoint. So it's better use rw_semaphore instead of mutex type for ->node_write to promote performance. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index a90f51d32482..7b5b5def65fe 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1231,12 +1231,12 @@ static int f2fs_write_node_page(struct page *page,
if (wbc->for_reclaim)
goto redirty_out;
- mutex_lock(&sbi->node_write);
+ down_read(&sbi->node_write);
set_page_writeback(page);
write_node_page(sbi, page, &fio, nid, ni.blk_addr, &new_addr);
set_node_addr(sbi, &ni, new_addr, is_fsync_dnode(page));
dec_page_count(sbi, F2FS_DIRTY_NODES);
- mutex_unlock(&sbi->node_write);
+ up_read(&sbi->node_write);
unlock_page(page);
return 0;