[PATCH 1/2] fs/block-dev.c:fix performance regression in O_DIRECT writes to md block devices.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For regular file, write operaion used blk_plug function.But for block
file,write operation did not use blk_plug.

Signed-off-by: Jianpeng Ma <majianpeng@xxxxxxxxx>
---
 fs/block_dev.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index c2bbe1f..22cd436 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -215,9 +215,14 @@ blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
 {
 	struct file *file = iocb->ki_filp;
 	struct inode *inode = file->f_mapping->host;
+	struct blk_plug plug;
+	ssize_t ret;
 
-	return __blockdev_direct_IO(rw, iocb, inode, I_BDEV(inode), iov, offset,
+	blk_start_plug(&plug);
+	ret =  __blockdev_direct_IO(rw, iocb, inode, I_BDEV(inode), iov, offset,
 				    nr_segs, blkdev_get_blocks, NULL, NULL, 0);
+	blk_finish_plug(&plug);
+	return ret;
 }
 
 int __sync_blockdev(struct block_device *bdev, int wait)
-- 
1.7.5.4
?韬{.n?????%??檩??w?{.n???{饼?z鳐??骅w*jg????????G??⒏⒎?:+v????????????"??????


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux