f2fs: remove redundant block plug
authorChao Yu <yuchao0@huawei.com>
Wed, 4 Apr 2018 09:35:13 +0000 (17:35 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 28 Jun 2018 21:39:31 +0000 (14:39 -0700)
For buffered IO, we don't need to use block plug to cache bio,
for direct IO, generic f2fs_direct_IO has already added block
plug, so let's remove redundant one in .write_iter.

As Yunlei described in his patch:

-f2fs_file_write_iter
  -blk_start_plug
    -__generic_file_write_iter
...
  -do_blockdev_direct_IO
    -blk_start_plug
...
    -blk_finish_plug
...
  -blk_finish_plug

which may conduct performance decrease in our platform

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index 137be39d2dd8da5e9abe751c5a2ceea3d74ec059..9a481240471d3e21eaa5fc26ada2c643f819fcb8 100644 (file)
@@ -2885,7 +2885,6 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
 {
        struct file *file = iocb->ki_filp;
        struct inode *inode = file_inode(file);
-       struct blk_plug plug;
        ssize_t ret;
 
        if (unlikely(f2fs_cp_error(F2FS_I_SB(inode))))
@@ -2930,9 +2929,7 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
                                return err;
                        }
                }
-               blk_start_plug(&plug);
                ret = __generic_file_write_iter(iocb, from);
-               blk_finish_plug(&plug);
                clear_inode_flag(inode, FI_NO_PREALLOC);
 
                /* if we couldn't write data, we should deallocate blocks. */