diff options
author | Isaac Huang <[email protected]> | 2016-09-29 14:13:31 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-02-03 10:25:12 -0800 |
commit | 6ebfe58117d478a369bea929973f4ac381aa6dea (patch) | |
tree | f69905ad567151743f886d1d669c08fd576ad62b /module/zfs | |
parent | 39d65926c966cedda8215251d2a3e9fa6f0faccb (diff) |
Explicit block device plugging when submitting multiple BIOs
Without plugging, the default 'noop' scheduler will not merge
the BIOs which are part of a large ZIO.
Reviewed-by: Andreas Dilger <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Isaac Huang <[email protected]>
Closes #5181
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/vdev_disk.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c index 393737377..5697f6867 100644 --- a/module/zfs/vdev_disk.c +++ b/module/zfs/vdev_disk.c @@ -520,6 +520,9 @@ __vdev_disk_physio(struct block_device *bdev, zio_t *zio, caddr_t kbuf_ptr, uint64_t bio_offset; int bio_size, bio_count = 16; int i = 0, error = 0; +#if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG) + struct blk_plug plug; +#endif ASSERT3U(kbuf_offset + kbuf_size, <=, bdev->bd_inode->i_size); @@ -590,11 +593,21 @@ retry: if (zio) zio->io_delay = jiffies_64; +#if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG) + if (dr->dr_bio_count > 1) + blk_start_plug(&plug); +#endif + /* Submit all bio's associated with this dio */ for (i = 0; i < dr->dr_bio_count; i++) if (dr->dr_bio[i]) vdev_submit_bio(dr->dr_bio[i]); +#if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG) + if (dr->dr_bio_count > 1) + blk_finish_plug(&plug); +#endif + (void) vdev_disk_dio_put(dr); return (error); |