aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-09-04 21:07:15 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-09-04 21:17:19 -0400
commit423e95ccbe2e2612ed9fe41667acfc338f3af07b (patch)
tree8d6e883066b2137ba474cbcbeecff5f36571781f /fs
parent222cbdc4835f8151b886b049d6ad56b18f88d470 (diff)
f2fs: merge more bios of node block writes
Previously, we experience bio traces as follows when running simple sequential write test. f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500104928, size = 4K f2fs_do_submit_bio: type = NODE, io = no sync, sector = 499922208, size = 368K f2fs_do_submit_bio: type = NODE, io = no sync, sector = 499914752, size = 140K -> total 512K The first one is to write an indirect node block, and the others are to write direct node blocks. The reason why there are two separate bios for direct node blocks is: 0. initial state ------------------ ------------------ | | |xxxxxxxx | ------------------ ------------------ 1. write 368K ------------------ ------------------ | | |xxxxxxxxWWWWWWWW| ------------------ ------------------ 2. write 140K ------------------ ------------------ |WWWWWWW | |xxxxxxxxWWWWWWWW| ------------------ ------------------ This is because f2fs_write_node_pages tries to write just 512K totally, so that we can lose the chance to merge more bios nicely. After this patch is applied, we can get the following bio traces. f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500103168, size = 8K f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500111368, size = 4K f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500107272, size = 512K f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500108296, size = 512K f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500109320, size = 500K And finally, we can improve the sequential write performance, from 458.775 MB/s to 479.945 MB/s on SSD. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/node.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index c3c03c975bd6..51ef27894433 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1191,9 +1191,9 @@ static int f2fs_write_node_page(struct page *page,
1191/* 1191/*
1192 * It is very important to gather dirty pages and write at once, so that we can 1192 * It is very important to gather dirty pages and write at once, so that we can
1193 * submit a big bio without interfering other data writes. 1193 * submit a big bio without interfering other data writes.
1194 * Be default, 512 pages (2MB), a segment size, is quite reasonable. 1194 * Be default, 512 pages (2MB) * 3 node types, is more reasonable.
1195 */ 1195 */
1196#define COLLECT_DIRTY_NODES 512 1196#define COLLECT_DIRTY_NODES 1536
1197static int f2fs_write_node_pages(struct address_space *mapping, 1197static int f2fs_write_node_pages(struct address_space *mapping,
1198 struct writeback_control *wbc) 1198 struct writeback_control *wbc)
1199{ 1199{
@@ -1211,9 +1211,10 @@ static int f2fs_write_node_pages(struct address_space *mapping,
1211 return 0; 1211 return 0;
1212 1212
1213 /* if mounting is failed, skip writing node pages */ 1213 /* if mounting is failed, skip writing node pages */
1214 wbc->nr_to_write = max_hw_blocks(sbi); 1214 wbc->nr_to_write = 3 * max_hw_blocks(sbi);
1215 sync_node_pages(sbi, 0, wbc); 1215 sync_node_pages(sbi, 0, wbc);
1216 wbc->nr_to_write = nr_to_write - (max_hw_blocks(sbi) - wbc->nr_to_write); 1216 wbc->nr_to_write = nr_to_write - (3 * max_hw_blocks(sbi) -
1217 wbc->nr_to_write);
1217 return 0; 1218 return 0;
1218} 1219}
1219 1220