Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f91efc4 authored by Chao Yu's avatar Chao Yu Committed by Greg Kroah-Hartman
Browse files

f2fs: try grabbing node page lock aggressively in sync scenario



[ Upstream commit 4b270a8cc5047682f0a3f3f9af3b498408dbd2bc ]

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: default avatarYunlei He <heyunlei@huawei.com>
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fd4e3615
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1610,7 +1610,9 @@ int sync_node_pages(struct f2fs_sb_info *sbi, struct writeback_control *wbc,
						!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))) {