summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-06-04 11:20:36 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2018-06-04 17:33:20 -0400
commitc29fd0c0e26dacb7a33ad166587059818a94b4e0 (patch)
tree6a25f17833047796fccde3cd7c4e17d35199e640 /fs/f2fs/gc.c
parentaae764ece6076b0852b95943c40748569c7b8585 (diff)
f2fs: let sync node IO interrupt async one
Although mixed sync/async IOs can have continuous LBA, as they have different IO priority, block IO scheduler will add them into different queues and commit them separately, result in splited IOs which causes wrose performance. This patch gives high priority to synchronous IO of nodes, means that once synchronous flow starts, it can interrupt asynchronous writeback flow of system flusher, so more big IOs can be expected. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 2a97ce7bc91d..9093be6e7a7d 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -473,12 +473,16 @@ static void gc_node_segment(struct f2fs_sb_info *sbi,
473 block_t start_addr; 473 block_t start_addr;
474 int off; 474 int off;
475 int phase = 0; 475 int phase = 0;
476 bool fggc = (gc_type == FG_GC);
476 477
477 start_addr = START_BLOCK(sbi, segno); 478 start_addr = START_BLOCK(sbi, segno);
478 479
479next_step: 480next_step:
480 entry = sum; 481 entry = sum;
481 482
483 if (fggc && phase == 2)
484 atomic_inc(&sbi->wb_sync_req[NODE]);
485
482 for (off = 0; off < sbi->blocks_per_seg; off++, entry++) { 486 for (off = 0; off < sbi->blocks_per_seg; off++, entry++) {
483 nid_t nid = le32_to_cpu(entry->nid); 487 nid_t nid = le32_to_cpu(entry->nid);
484 struct page *node_page; 488 struct page *node_page;
@@ -525,6 +529,9 @@ next_step:
525 529
526 if (++phase < 3) 530 if (++phase < 3)
527 goto next_step; 531 goto next_step;
532
533 if (fggc)
534 atomic_dec(&sbi->wb_sync_req[NODE]);
528} 535}
529 536
530/* 537/*