diff options
author | Fan Li <fanofcode.li@samsung.com> | 2013-12-09 03:09:00 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-12-22 20:18:06 -0500 |
commit | 63a0b7cb33d85aeb0df39b984c08e234db4925d1 (patch) | |
tree | 75de6dbf2311e606124221d11344bc3ad8e2ebfa /fs/f2fs/gc.c | |
parent | 6bacf52fb58aeb3e89d9a62970b85a5570aa8ace (diff) |
f2fs: merge pages with the same sync_mode flag
Previously f2fs submits most of write requests using WRITE_SYNC, but f2fs_write_data_pages
submits last write requests by sync_mode flags callers pass.
This causes a performance problem since continuous pages with different sync flags
can't be merged in cfq IO scheduler(thanks yu chao for pointing it out), and synchronous
requests often take more time.
This patch makes the following modifies to DATA writebacks:
1. every page will be written back using the sync mode caller pass.
2. only pages with the same sync mode can be merged in one bio request.
These changes are restricted to DATA pages.Other types of writebacks are modified
To remain synchronous.
In my test with tiotest, f2fs sequence write performance is improved by about 7%-10% ,
and this patch has no obvious impact on other performance tests.
Signed-off-by: Fan Li <fanofcode.li@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r-- | fs/f2fs/gc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 29ceb9d71c8c..c68fba5ffadb 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c | |||
@@ -520,6 +520,10 @@ static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, | |||
520 | 520 | ||
521 | static void move_data_page(struct inode *inode, struct page *page, int gc_type) | 521 | static void move_data_page(struct inode *inode, struct page *page, int gc_type) |
522 | { | 522 | { |
523 | struct writeback_control wbc = { | ||
524 | .sync_mode = 1, | ||
525 | }; | ||
526 | |||
523 | if (gc_type == BG_GC) { | 527 | if (gc_type == BG_GC) { |
524 | if (PageWriteback(page)) | 528 | if (PageWriteback(page)) |
525 | goto out; | 529 | goto out; |
@@ -536,7 +540,7 @@ static void move_data_page(struct inode *inode, struct page *page, int gc_type) | |||
536 | inode_dec_dirty_dents(inode); | 540 | inode_dec_dirty_dents(inode); |
537 | } | 541 | } |
538 | set_cold_data(page); | 542 | set_cold_data(page); |
539 | do_write_data_page(page); | 543 | do_write_data_page(page, &wbc); |
540 | clear_cold_data(page); | 544 | clear_cold_data(page); |
541 | } | 545 | } |
542 | out: | 546 | out: |