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

Commit 46ae957f authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: remove two steps to flush dirty data pages



If there is no cold page, we don't need to do a loop to flush dirty
data pages.

On /dev/pmem0,

1. dd if=/dev/zero of=/mnt/test/testfile bs=1M count=2048 conv=fsync
 Before : 1.1 GB/s
 After  : 1.2 GB/s

2. dd if=/dev/zero of=/mnt/test/testfile bs=1M count=2048
 Before : 2.2 GB/s
 After  : 2.3 GB/s

Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 28ea6162
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -1326,10 +1326,9 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
	int cycled;
	int range_whole = 0;
	int tag;
	int step = 0;

	pagevec_init(&pvec, 0);
next:

	if (wbc->range_cyclic) {
		writeback_index = mapping->writeback_index; /* prev offset */
		index = writeback_index;
@@ -1384,9 +1383,6 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
				goto continue_unlock;
			}

			if (step == is_cold_data(page))
				goto continue_unlock;

			if (PageWriteback(page)) {
				if (wbc->sync_mode != WB_SYNC_NONE)
					f2fs_wait_on_page_writeback(page,
@@ -1421,11 +1417,6 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
		cond_resched();
	}

	if (step < 1) {
		step++;
		goto next;
	}

	if (!cycled && !done) {
		cycled = 1;
		index = 0;