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

Commit fd36b4ba authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: detect synchronous writeback more earlier



This patch changes to detect synchronous writeback more earlier before,
in order to avoid unnecessary page writeback before exiting asynchronous
writeback.

Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 767fcf33
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1962,6 +1962,13 @@ retry:
			struct page *page = pvec.pages[i];
			bool submitted = false;

			/* give a priority to WB_SYNC threads */
			if (atomic_read(&F2FS_M_SB(mapping)->wb_sync_req) &&
					wbc->sync_mode == WB_SYNC_NONE) {
				done = 1;
				break;
			}

			done_index = page->index;
retry_write:
			lock_page(page);
@@ -2016,9 +2023,7 @@ continue_unlock:
				last_idx = page->index;
			}

			/* give a priority to WB_SYNC threads */
			if ((atomic_read(&F2FS_M_SB(mapping)->wb_sync_req) ||
					--wbc->nr_to_write <= 0) &&
			if (--wbc->nr_to_write <= 0 &&
					wbc->sync_mode == WB_SYNC_NONE) {
				done = 1;
				break;