From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0ty6-0003zI-9x for qemu-devel@nongnu.org; Tue, 16 Dec 2014 10:23:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0txr-0002GO-UW for qemu-devel@nongnu.org; Tue, 16 Dec 2014 10:23:22 -0500 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:60663 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0txr-0002Fu-KL for qemu-devel@nongnu.org; Tue, 16 Dec 2014 10:23:07 -0500 From: Peter Lieven Date: Tue, 16 Dec 2014 16:21:23 +0100 Message-Id: <1418743287-20467-1-git-send-email-pl@kamp.de> Subject: [Qemu-devel] [PATCH V2 0/4] *virtio-blk: add multiread support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, benoit@irqsave.net, ming.lei@canonical.com, Peter Lieven , armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com 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 knob to disable request merging is not yet there. I would add it to the device properties also as a generic interface to have the same switch for any driver that might introduce request merging in the future. As there has been no knob in the past I would post this as a seperate series as it needs some mangling in parameter parsing which might lead to further discussions. - the old multiwrite interface is still there and might be removed. 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 (4): 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 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 | 6 +- hw/block/virtio-blk.c | 242 ++++++++++++++++++++++++--------------- include/block/accounting.h | 3 + include/hw/virtio/virtio-blk.h | 20 +++- include/sysemu/block-backend.h | 1 + qapi/block-core.json | 9 +- qmp-commands.hx | 22 +++- trace-events | 1 + 13 files changed, 216 insertions(+), 110 deletions(-) -- 1.7.9.5