Stefan Hajnoczi
2022-Apr-05 09:09 UTC
[PATCH v4 2/2] virtio-blk: support mq_ops->queue_rqs()
On Tue, Apr 05, 2022 at 02:31:22PM +0900, Suwan Kim wrote:> This patch supports mq_ops->queue_rqs() hook. It has an advantage of > batch submission to virtio-blk driver. It also helps polling I/O because > polling uses batched completion of block layer. Batch submission in > queue_rqs() can boost polling performance. > > In queue_rqs(), it iterates plug->mq_list, collects requests that > belong to same HW queue until it encounters a request from other > HW queue or sees the end of the list. > Then, virtio-blk adds requests into virtqueue and kicks virtqueue > to submit requests. > > If there is an error, it inserts error request to requeue_list and > passes it to ordinary block layer path. > > For verification, I did fio test. > (io_uring, randread, direct=1, bs=4K, iodepth=64 numjobs=N) > I set 4 vcpu and 2 virtio-blk queues for VM and run fio test 5 times. > It shows about 2% improvement. > > | numjobs=2 | numjobs=4 > ----------------------------------------------------------- > fio without queue_rqs() | 291K IOPS | 238K IOPS > ----------------------------------------------------------- > fio with queue_rqs() | 295K IOPS | 243K IOPS > > For polling I/O performance, I also did fio test as below. > (io_uring, hipri, randread, direct=1, bs=512, iodepth=64 numjobs=4) > I set 4 vcpu and 2 poll queues for VM. > It shows about 2% improvement in polling I/O. > > | IOPS | avg latency > ----------------------------------------------------------- > fio poll without queue_rqs() | 424K | 613.05 usec > ----------------------------------------------------------- > fio poll with queue_rqs() | 435K | 601.01 usec > > Signed-off-by: Suwan Kim <suwan.kim027 at gmail.com> > --- > drivers/block/virtio_blk.c | 110 +++++++++++++++++++++++++++++++++---- > 1 file changed, 99 insertions(+), 11 deletions(-)Reviewed-by: Stefan Hajnoczi <stefanha at redhat.com> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20220405/36afabc4/attachment-0001.sig>