aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-10-08 13:40:07 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2015-10-12 16:38:02 -0400
commita125702326d9c3b753fe9c9b9727d3b3dd1cba4a (patch)
tree7c6407982fb0db047c1a5233eed3c24b4df192f9 /fs
parentc912a8298c16ef15aa2b7203022c935f439f488b (diff)
Revert "f2fs: do not skip dentry block writes"
The periodic checkpoint can resolve the previous issue. So, now we can use this again to improve the reported performance regression: https://lkml.org/lkml/2015/10/8/20 This reverts commit 15bec0ff5a9ba6d203178fa8772259df6207942a.
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/data.c5
-rw-r--r--fs/f2fs/node.c5
-rw-r--r--fs/f2fs/node.h1
-rw-r--r--fs/f2fs/segment.h4
4 files changed, 14 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index a903423e4cd5..bc04e9201fd6 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1340,6 +1340,11 @@ static int f2fs_write_data_pages(struct address_space *mapping,
1340 if (!get_dirty_pages(inode) && wbc->sync_mode == WB_SYNC_NONE) 1340 if (!get_dirty_pages(inode) && wbc->sync_mode == WB_SYNC_NONE)
1341 return 0; 1341 return 0;
1342 1342
1343 if (S_ISDIR(inode->i_mode) && wbc->sync_mode == WB_SYNC_NONE &&
1344 get_dirty_pages(inode) < nr_pages_to_skip(sbi, DATA) &&
1345 available_free_memory(sbi, DIRTY_DENTS))
1346 goto skip_write;
1347
1343 /* during POR, we don't need to trigger writepage at all. */ 1348 /* during POR, we don't need to trigger writepage at all. */
1344 if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING))) 1349 if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
1345 goto skip_write; 1350 goto skip_write;
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 1fe49ca20757..4d9bedfe101c 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -52,6 +52,11 @@ bool available_free_memory(struct f2fs_sb_info *sbi, int type)
52 mem_size = (nm_i->nat_cnt * sizeof(struct nat_entry)) >> 52 mem_size = (nm_i->nat_cnt * sizeof(struct nat_entry)) >>
53 PAGE_CACHE_SHIFT; 53 PAGE_CACHE_SHIFT;
54 res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 2); 54 res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 2);
55 } else if (type == DIRTY_DENTS) {
56 if (sbi->sb->s_bdi->wb.dirty_exceeded)
57 return false;
58 mem_size = get_pages(sbi, F2FS_DIRTY_DENTS);
59 res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1);
55 } else if (type == INO_ENTRIES) { 60 } else if (type == INO_ENTRIES) {
56 int i; 61 int i;
57 62
diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h
index 51c62edf2e89..7427e956ad81 100644
--- a/fs/f2fs/node.h
+++ b/fs/f2fs/node.h
@@ -118,6 +118,7 @@ static inline void raw_nat_from_node_info(struct f2fs_nat_entry *raw_ne,
118enum mem_type { 118enum mem_type {
119 FREE_NIDS, /* indicates the free nid list */ 119 FREE_NIDS, /* indicates the free nid list */
120 NAT_ENTRIES, /* indicates the cached nat entry */ 120 NAT_ENTRIES, /* indicates the cached nat entry */
121 DIRTY_DENTS, /* indicates dirty dentry pages */
121 INO_ENTRIES, /* indicates inode entries */ 122 INO_ENTRIES, /* indicates inode entries */
122 EXTENT_CACHE, /* indicates extent cache */ 123 EXTENT_CACHE, /* indicates extent cache */
123 BASE_CHECK, /* check kernel status */ 124 BASE_CHECK, /* check kernel status */
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index e9afb5884312..ee44d346ea44 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -699,7 +699,9 @@ static inline int nr_pages_to_skip(struct f2fs_sb_info *sbi, int type)
699 if (sbi->sb->s_bdi->wb.dirty_exceeded) 699 if (sbi->sb->s_bdi->wb.dirty_exceeded)
700 return 0; 700 return 0;
701 701
702 if (type == NODE) 702 if (type == DATA)
703 return sbi->blocks_per_seg;
704 else if (type == NODE)
703 return 3 * sbi->blocks_per_seg; 705 return 3 * sbi->blocks_per_seg;
704 else if (type == META) 706 else if (type == META)
705 return MAX_BIO_BLOCKS(sbi); 707 return MAX_BIO_BLOCKS(sbi);