]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
f2fs: do not skip dentry block writes
authorJaegeuk Kim <jaegeuk@kernel.org>
Sat, 26 Sep 2015 02:34:50 +0000 (19:34 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 9 Oct 2015 23:20:54 +0000 (16:20 -0700)
Previously, we skip dentry block writes when wbc is SYNC_NONE with no memory
pressure and the number of dirty pages is pretty small.

But, we didn't skip for normal data writes, which gives us not much big impact
on overall performance.
Moreover, by skipping some data writes, kworker falls into infinite loop to try
to write blocks, when many dir inodes have only one dentry block.

So, this patch removes skipping data writes.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/node.c
fs/f2fs/node.h
fs/f2fs/segment.h

index bc04e9201fd60f9cd556eb5d2cabed724b1168dc..a903423e4cd5cdab1814f44d9924e29ae5625abb 100644 (file)
@@ -1340,11 +1340,6 @@ static int f2fs_write_data_pages(struct address_space *mapping,
        if (!get_dirty_pages(inode) && wbc->sync_mode == WB_SYNC_NONE)
                return 0;
 
-       if (S_ISDIR(inode->i_mode) && wbc->sync_mode == WB_SYNC_NONE &&
-                       get_dirty_pages(inode) < nr_pages_to_skip(sbi, DATA) &&
-                       available_free_memory(sbi, DIRTY_DENTS))
-               goto skip_write;
-
        /* during POR, we don't need to trigger writepage at all. */
        if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
                goto skip_write;
index 4d9bedfe101c9b843524fbbbe3edbc32f4d3eb8c..1fe49ca2075776824c8e77424245389267203dd0 100644 (file)
@@ -52,11 +52,6 @@ bool available_free_memory(struct f2fs_sb_info *sbi, int type)
                mem_size = (nm_i->nat_cnt * sizeof(struct nat_entry)) >>
                                                        PAGE_CACHE_SHIFT;
                res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 2);
-       } else if (type == DIRTY_DENTS) {
-               if (sbi->sb->s_bdi->wb.dirty_exceeded)
-                       return false;
-               mem_size = get_pages(sbi, F2FS_DIRTY_DENTS);
-               res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1);
        } else if (type == INO_ENTRIES) {
                int i;
 
index 7427e956ad81431be9e890354b7535d9a366575e..51c62edf2e893a4d968f4a23521420ad5c56bf05 100644 (file)
@@ -118,7 +118,6 @@ static inline void raw_nat_from_node_info(struct f2fs_nat_entry *raw_ne,
 enum mem_type {
        FREE_NIDS,      /* indicates the free nid list */
        NAT_ENTRIES,    /* indicates the cached nat entry */
-       DIRTY_DENTS,    /* indicates dirty dentry pages */
        INO_ENTRIES,    /* indicates inode entries */
        EXTENT_CACHE,   /* indicates extent cache */
        BASE_CHECK,     /* check kernel status */
index b6e4ed15c6988f416b374350cc2cdd57f6763c01..a294da70a7b5c76f0ff1597454fd6c3f9c0828b4 100644 (file)
@@ -697,9 +697,7 @@ static inline int nr_pages_to_skip(struct f2fs_sb_info *sbi, int type)
        if (sbi->sb->s_bdi->wb.dirty_exceeded)
                return 0;
 
-       if (type == DATA)
-               return sbi->blocks_per_seg;
-       else if (type == NODE)
+       if (type == NODE)
                return 3 * sbi->blocks_per_seg;
        else if (type == META)
                return MAX_BIO_BLOCKS(sbi);