From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v7 06/19] scsi-disk: Switch to byte-based aio block access
Date: Tue, 10 May 2016 06:56:33 -0600 [thread overview]
Message-ID: <5731DA81.90702@redhat.com> (raw)
In-Reply-To: <20160510085544.GE4921@noname.str.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1777 bytes --]
On 05/10/2016 02:55 AM, Kevin Wolf wrote:
> Am 06.05.2016 um 18:26 hat Eric Blake geschrieben:
>> Sector-based blk_aio_readv() and blk_aio_writev() should die; switch
>> to byte-based blk_aio_preadv() and blk_aio_pwritev() instead.
>>
>> As part of the cleanup, scsi_init_iovec() no longer needs to return
>> a value, and reword a comment.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>
>> @@ -118,7 +118,6 @@ static uint32_t scsi_init_iovec(SCSIDiskReq *r, size_t size)
>> }
>> r->iov.iov_len = MIN(r->sector_count * 512, r->buflen);
>> qemu_iovec_init_external(&r->qiov, &r->iov, 1);
>> - return r->qiov.size / 512;
>
> The return value was MIN(r->sector_count, SCSI_DMA_BUF_SIZE / 512).
>
>> }
>>
>> static void scsi_disk_save_request(QEMUFile *f, SCSIRequest *req)
>> - n = scsi_init_iovec(r, SCSI_DMA_BUF_SIZE);
>> + scsi_init_iovec(r, SCSI_DMA_BUF_SIZE);
>> block_acct_start(blk_get_stats(s->qdev.conf.blk), &r->acct,
>> - n * BDRV_SECTOR_SIZE, BLOCK_ACCT_READ);
>> - r->req.aiocb = blk_aio_readv(s->qdev.conf.blk, r->sector, &r->qiov, n,
>> - scsi_read_complete, r);
>> + SCSI_DMA_BUF_SIZE, BLOCK_ACCT_READ);
>
> But here you use SCSI_DMA_BUF_SIZE without considering r->sector_count.
> Is this correct or are requests that are smaller than SCSI_DMA_BUF_SIZE
> now accounted for more data than they actually read?
>
> Would r->qiov.size be more obviously correct? You did that for writes.
Yes. Is that something you are able to fix on commit, or should I submit
a fixup?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-05-10 12:56 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-06 16:26 [Qemu-devel] [PATCH v7 00/19] block: kill sector-based blk_write/read Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 01/19] block: Allow BDRV_REQ_FUA through blk_pwrite() Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 02/19] block: Switch blk_read_unthrottled() to byte interface Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 03/19] block: Switch blk_*write_zeroes() " Eric Blake
2016-05-23 15:42 ` Kevin Wolf
2016-05-23 16:03 ` Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 04/19] block: Introduce byte-based aio read/write Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 05/19] ide: Switch to byte-based aio block access Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 06/19] scsi-disk: " Eric Blake
2016-05-10 8:55 ` Kevin Wolf
2016-05-10 12:56 ` Eric Blake [this message]
2016-05-10 14:49 ` Kevin Wolf
2016-05-12 11:25 ` Paolo Bonzini
2016-05-12 11:26 ` Paolo Bonzini
2016-05-12 16:58 ` Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 07/19] virtio: " Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 08/19] xen_disk: " Eric Blake
2016-05-06 16:26 ` Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 09/19] fdc: Switch to byte-based " Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 10/19] nand: " Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 11/19] onenand: " Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 12/19] pflash: " Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 13/19] sd: " Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 14/19] m25p80: " Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 15/19] atapi: " Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 16/19] nbd: " Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 17/19] qemu-img: " Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 18/19] qemu-io: " Eric Blake
2016-05-06 16:26 ` [Qemu-devel] [PATCH v7 19/19] block: Kill unused sector-based blk_* functions Eric Blake
2016-05-10 8:56 ` [Qemu-devel] [PATCH v7 00/19] block: kill sector-based blk_write/read Kevin Wolf
2016-05-10 15:06 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5731DA81.90702@redhat.com \
--to=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.