virtio-blk: base queue-depth on virtqueue ringsize or module param
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 25 Jun 2014 19:06:59 +0000 (13:06 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 30 Mar 2015 18:54:44 +0000 (12:54 -0600)
commitad68f138548d30a46a626132f50cf59775753a7d
treea5525ab1ac43203ae0e5a1f27cac5e0c612ce80c
parentbbffe05c018e0135c17da31d034607cd646d921e
virtio-blk: base queue-depth on virtqueue ringsize or module param

Venkatash spake thus:

  virtio-blk set the default queue depth to 64 requests, which was
  insufficient for high-IOPS devices. Instead set the blk-queue depth to
  the device's virtqueue depth divided by two (each I/O requires at least
  two VQ entries).

But behold, Ted added a module parameter:

  Also allow the queue depth to be something which can be set at module
  load time or via a kernel boot-time parameter, for
  testing/benchmarking purposes.

And I rewrote it substantially, mainly to take
VIRTIO_RING_F_INDIRECT_DESC into account.

As QEMU sets the vq size for PCI to 128, Venkatash's patch wouldn't
have made a change.  This version does (since QEMU also offers
VIRTIO_RING_F_INDIRECT_DESC.

Inspired-by: "Theodore Ts'o" <tytso@mit.edu>
Based-on-the-true-story-of: Venkatesh Srinivas <venkateshs@google.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: virtio-dev@lists.oasis-open.org
Cc: virtualization@lists.linux-foundation.org
Cc: Frank Swiderski <fes@google.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/block/virtio_blk.c