Skip to content

this series adds the long missing multiread support to virtio-blk.

Peter Lieven qemu-devel 4 versions – Applied

Status from this message: Thanks, applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 1 replyApplied
  2. v34 patches 9 repliesSuperseded
  3. v24 patches 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches9 repliesSuperseded

Changes in v4 from the cover letter

- added a patch to disable request merging in the virtio-blk device
- changed some static function names [Max]
- removed _identifiers [Max]
- removed to +1 in the check for max iovectors merged [Max, Kevin]
- changed type & 0xff to type & ~(VIRTIO_BLK_T_OUT | VIRTIO_BLK_T_BARRIER) [Max]
- initialize qiov before bounds check [Max]
- added an assertion to avoid overflowing mrb->reqs array [Max]
- added comments about the usage of qiov (internal vs. external) [Max]

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/5block: add accounting for merged requestsblock.c block/accounting.c block/qapi.c +4 more+45 -60 replies
2/5hw/virtio-blk: add a constant for max number of merged requestshw/block/virtio-blk.c include/hw/virtio/virtio-blk.h+4 -20 replies
3/5block-backend: expose bs->bl.max_transfer_lengthblock/block-backend.c include/sysemu/block-backend.h+6 -00 replies
4/5virtio-blk: introduce multireadhw/block/dataplane/virtio-blk.c hw/block/virtio-blk.c include/hw/virtio/virtio-blk.h +1 more+218 -1060 replies
5/5virtio-blk: add a knob to disable request merginghw/block/virtio-blk.c include/hw/virtio/virtio-blk.h+5 -10 replies

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by.

PatchEric BlakeMax Reitz
1/5R-b R-b
2/5R-b R-b
3/5R-b
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [Qemu-devel] [PATCH v4 0/5] this series adds the long missing multiread support to virtio-blk.

some remarks:
- i introduced rd_merged and wr_merged block accounting stats to blockstats as a generic interface which can be set from any driver that will introduce multirequest merging in the future.
- the old multiwrite interface is still there and might be removed.

v3->v4:
- added a patch to disable request merging in the virtio-blk device
- changed some static function names [Max]
- removed _identifiers [Max]
- removed to +1 in the check for max iovectors merged [Max, Kevin]
- changed type & 0xff to type & ~(VIRTIO_BLK_T_OUT | VIRTIO_BLK_T_BARRIER) [Max]
- initialize qiov before bounds check [Max]
- added an assertion to avoid overflowing mrb->reqs array [Max]
- added comments about the usage of qiov (internal vs. external) [Max]

v2->v3:
- completely reworked Patch 4 as it turned out that depending on the kernel even sequential requests fly in out of order or we receive a mix from different software queues.

v1->v2:
- add overflow checking for nb_sectors [Kevin]
- do not change the name of the macro of max mergable requests. [Fam]

RFC v2->v1:
- added Erics grammar corrections to Patch 4
- Patch 4
- reworked the IF tree to a SWITCH statement to make it easier to understand in virtio_blk_handle_request
- stop merging if requests switch from read to write or vice versa. e..g, otherwise we could introduce big delays as a small read request could be followed by a lot of write requests and the read requests sits there until the queue is empty.

RFC v1->RFC v2:
- completed Patch 1 by the example in qmp-commands.hx [Eric]
- used bool for merge in Patch 4 [Max]
- fixed a few typos in the commit msg of Patch 4 [Max]
- do not start merging and directly pass req[0]->qiov in case of num_reqs == 1
- avoid allocating memory for the multireq [Kevin]
- do not import block_int.h and add appropiate iface to block-backend [Kevin]
- removed debug output and added trace event for multireq [Kevin]
- fixed alloc hint for the merge qiov [Kevin]
- currently did not split virtio_submit_multireq into rw code since the redundant code would now be much bigger part than in the original patch.
- added a merge_qiov to VirtioBlockRequest. Abusing the qiov was not possible because it is initialized externally with guest memory [Kevin]
- added a pointer to VirtioBlockRequest to create a linked list of VirtioBlockBlockRequests. This list is used to complete all requests belonging to a multireq [Kevin]

Peter Lieven (5):
block: add accounting for merged requests hw/virtio-blk: add a constant for max number of merged requests
block-backend: expose bs->bl.max_transfer_length
virtio-blk: introduce multiread
virtio-blk: add a knob to disable request merging

 block.c                         |   2 +
 block/accounting.c              |   7 +
 block/block-backend.c           |   5 +
 block/qapi.c                    |   2 +
 hmp.c                           |   6 +-
 hw/block/dataplane/virtio-blk.c |   8 +-
 hw/block/virtio-blk.c           | 299 +++++++++++++++++++++++++++-------------
 include/block/accounting.h      |   3 +
 include/hw/virtio/virtio-blk.h  |  18 ++-
 include/sysemu/block-backend.h  |   1 +
 qapi/block-core.json            |   9 +-
 qmp-commands.hx                 |  22 ++-
 trace-events                    |   1 +
 13 files changed, 273 insertions(+), 110 deletions(-)
Signature · 1 line
1.9.1