The current virtio block sets a queue depth of 64. With a sufficiently fast device, using a queue depth of 256 can double the IOPS which can be sustained. So make the queue depth something which can be set at module load time or via a kernel boot-time parameter. Signed-off-by: "Theodore Ts'o" <tytso at mit.edu> Cc: Rusty Russell <rusty at rustcorp.com.au> Cc: "Michael S. Tsirkin" <mst at redhat.com> Cc: virtio-dev at lists.oasis-open.org Cc: virtualization at lists.linux-foundation.org Cc: fes at google.com --- drivers/block/virtio_blk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 6a680d4..0c9e57f 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -481,6 +481,9 @@ static struct blk_mq_ops virtio_mq_ops = { .free_hctx = blk_mq_free_single_hw_queue, }; +static int queue_depth = 64; +module_param(queue_depth, int, 444); + static struct blk_mq_reg virtio_mq_reg = { .ops = &virtio_mq_ops, .nr_hw_queues = 1, @@ -551,6 +554,7 @@ static int virtblk_probe(struct virtio_device *vdev) goto out_free_vq; } + virtio_mq_reg.queue_depth = queue_depth; virtio_mq_reg.cmd_size sizeof(struct virtblk_req) + sizeof(struct scatterlist) * sg_elems; -- 1.9.0
On Fri, 2014-03-14 at 13:31 -0400, Theodore Ts'o wrote:> The current virtio block sets a queue depth of 64. With a > sufficiently fast device, using a queue depth of 256 can double the > IOPS which can be sustained. So make the queue depth something which > can be set at module load time or via a kernel boot-time parameter.[]> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c[]> @@ -481,6 +481,9 @@ static struct blk_mq_ops virtio_mq_ops = { > .free_hctx = blk_mq_free_single_hw_queue, > }; > > +static int queue_depth = 64; > +module_param(queue_depth, int, 444);444? Really Ted? 0444
On Fri, Mar 14, 2014 at 10:38:40AM -0700, Joe Perches wrote:> > +static int queue_depth = 64; > > +module_param(queue_depth, int, 444); > > 444? Really Ted?Oops, *blush*. Thanks for catching that. - Ted
Maybe Matching Threads
- [PATCH] virtio-blk: make the queue depth configurable
- [PATCH] virtio-blk: Initialize blkqueue depth from virtqueue size
- [PATCH] virtio-blk: Initialize blkqueue depth from virtqueue size
- [PATCH] virtio-blk: make the queue depth the max supportable by the hypervisor
- [PATCH] virtio-blk: make the queue depth the max supportable by the hypervisor