[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v9 22/27] virtio-blk: Fix request merging
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [RFC v9 22/27] virtio-blk: Fix request merging |
Date: |
Wed, 18 Jul 2012 22:04:45 +0300 |
On Wed, Jul 18, 2012 at 04:07:49PM +0100, Stefan Hajnoczi wrote:
> Khoa Huynh <address@hidden> discovered that request merging is broken.
> The merged iocb is not updated to reflect the total number of iovecs and
> the offset is also outdated.
>
> This patch fixes request merging.
>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
So all these fixups need to be folded in making it correct first time.
> ---
> hw/virtio-blk.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
> index 9131a7a..51807b5 100644
> --- a/hw/virtio-blk.c
> +++ b/hw/virtio-blk.c
> @@ -178,13 +178,17 @@ static void merge_request(struct iocb *iocb_a, struct
> iocb *iocb_b)
> req_a->len = iocb_nbytes(iocb_a);
> }
>
> - iocb_b->u.v.vec = iovec;
> - req_b->len = iocb_nbytes(iocb_b);
> - req_b->next_merged = req_a;
> /*
> fprintf(stderr, "merged %p (%u) and %p (%u), %u iovecs in total\n",
> req_a, iocb_a->u.v.nr, req_b, iocb_b->u.v.nr, iocb_a->u.v.nr +
> iocb_b->u.v.nr);
> */
> +
> + iocb_b->u.v.vec = iovec;
> + iocb_b->u.v.nr += iocb_a->u.v.nr;
> + iocb_b->u.v.offset = iocb_a->u.v.offset;
> +
> + req_b->len = iocb_nbytes(iocb_b);
> + req_b->next_merged = req_a;
> }
>
> static void process_request(IOQueue *ioq, struct iovec iov[], unsigned int
> out_num, unsigned int in_num, unsigned int head)
> --
> 1.7.10.4
- Re: [Qemu-devel] [RFC v9 18/27] virtio-blk: Call ioctl() directly instead of irqfd, (continued)
- [Qemu-devel] [RFC v9 21/27] virtio-blk: Add basic request merging, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 20/27] virtio-blk: Add ioscheduler to detect mergable requests, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 26/27] msix: use upstream kvm_irqchip_set_irq(), Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 19/27] virtio-blk: Disable guest->host notifies while processing vring, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 27/27] virtio-blk: add EVENT_IDX support to dataplane, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 24/27] virtio-blk: fix incorrect length, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 17/27] virtio-blk: Use guest notifier to raise interrupts, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 25/27] msix: fix irqchip breakage in msix_try_notify_from_thread(), Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 22/27] virtio-blk: Fix request merging, Stefan Hajnoczi, 2012/07/18
- Re: [Qemu-devel] [RFC v9 22/27] virtio-blk: Fix request merging,
Michael S. Tsirkin <=
- Re: [Qemu-devel] [RFC v9 00/27] virtio: virtio-blk data plane, Michael S. Tsirkin, 2012/07/18
- Re: [Qemu-devel] [RFC v9 00/27] virtio: virtio-blk data plane, Michael S. Tsirkin, 2012/07/18