aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2014-03-17 23:40:49 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-03-18 00:58:59 -0400
commit87d6f890944d092c4ef5b84053f0d0d5d8137b0b (patch)
treeb66d6ff07f4e9d838f43e3ddb0eae916507ce343 /fs/f2fs/node.c
parentf8b2c1f940dca2843fe13b55ba5868bac8040551 (diff)
f2fs: avoid small data writes by skipping writepages
This patch introduces nr_pages_to_skip(sbi, type) to determine writepages can be skipped. The dentry, node, and meta pages can be conrolled by F2FS without breaking the FS consistency. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 3e36240d81c1..cb514f1896ab 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1198,12 +1198,6 @@ redirty_out:
1198 return AOP_WRITEPAGE_ACTIVATE; 1198 return AOP_WRITEPAGE_ACTIVATE;
1199} 1199}
1200 1200
1201/*
1202 * It is very important to gather dirty pages and write at once, so that we can
1203 * submit a big bio without interfering other data writes.
1204 * Be default, 512 pages (2MB) * 3 node types, is more reasonable.
1205 */
1206#define COLLECT_DIRTY_NODES 1536
1207static int f2fs_write_node_pages(struct address_space *mapping, 1201static int f2fs_write_node_pages(struct address_space *mapping,
1208 struct writeback_control *wbc) 1202 struct writeback_control *wbc)
1209{ 1203{
@@ -1214,7 +1208,7 @@ static int f2fs_write_node_pages(struct address_space *mapping,
1214 f2fs_balance_fs_bg(sbi); 1208 f2fs_balance_fs_bg(sbi);
1215 1209
1216 /* collect a number of dirty node pages and write together */ 1210 /* collect a number of dirty node pages and write together */
1217 if (get_pages(sbi, F2FS_DIRTY_NODES) < COLLECT_DIRTY_NODES) 1211 if (get_pages(sbi, F2FS_DIRTY_NODES) < nr_pages_to_skip(sbi, NODE))
1218 return 0; 1212 return 0;
1219 1213
1220 /* if mounting is failed, skip writing node pages */ 1214 /* if mounting is failed, skip writing node pages */