diff options
author | Chao Yu <yuchao0@huawei.com> | 2018-07-04 18:04:10 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-07-28 18:26:08 -0700 |
commit | 4b270a8cc5047682f0a3f3f9af3b498408dbd2bc (patch) | |
tree | 134cb65533577abc680ad9e97383232678664c7a /fs/f2fs/node.c | |
parent | dc1328027b53586cc6b668c6654f9482e505699c (diff) |
f2fs: try grabbing node page lock aggressively in sync scenario
In synchronous scenario, like in checkpoint(), we are going to flush
dirty node pages to device synchronously, we can easily failed
writebacking node page due to trylock_page() failure, especially in
condition of intensive lock competition, which can cause long latency
of checkpoint(). So let's use lock_page() in synchronous scenario to
avoid this issue.
Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r-- | fs/f2fs/node.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 6f21319d08d3..82664733f770 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1638,7 +1638,9 @@ next_step: !is_cold_node(page))) continue; lock_node: - if (!trylock_page(page)) + if (wbc->sync_mode == WB_SYNC_ALL) + lock_page(page); + else if (!trylock_page(page)) continue; if (unlikely(page->mapping != NODE_MAPPING(sbi))) { |