From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, Fam Zheng <famz@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 01/17] block: Convert bdrv_co_discard() to byte-based
Date: Fri, 15 Jul 2016 15:42:00 -0600 [thread overview]
Message-ID: <578958A8.7000908@redhat.com> (raw)
In-Reply-To: <1466610674-23157-2-git-send-email-eblake@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1578 bytes --]
On 06/22/2016 09:50 AM, Eric Blake wrote:
> Another step towards byte-based interfaces everywhere. Replace
> the sector-based bdrv_co_discard() with a new byte-based
> bdrv_co_pdiscard(), which silently ignores any unaligned head
> or tail. Driver callbacks will be converted in followup patches.
>
> By calculating the alignment outside of the loop, and clamping
> the max discard to an aligned value, we can simplify the actions
> done within the loop.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> +++ b/block/io.c
> +int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset,
> + int count)
> - tracked_request_begin(&req, bs, sector_num << BDRV_SECTOR_BITS,
> - nb_sectors << BDRV_SECTOR_BITS, BDRV_TRACKED_DISCARD);
> + /* Discard is advisory, so ignore any unaligned head or tail */
> + align = MAX(BDRV_SECTOR_SIZE,
> + MAX(bs->bl.pdiscard_alignment, bs->bl.request_alignment));
> + assert(is_power_of_2(align));
And this further ingrains the already existing problem with iscsi
devices that advertise 15M for discard alignment. Is it more important
for me to fix that regression first then base this series on top of
that, or is it acceptable for me to repost this series and then work on
the regression fix? I'd prefer the latter course of action, as a
regression fix is good material for post-hardfreeze.
--
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-07-15 21:42 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-22 15:50 [Qemu-devel] [PATCH 00/17] byte-based block discard Eric Blake
2016-06-22 15:50 ` [Qemu-devel] [PATCH 01/17] block: Convert bdrv_co_discard() to byte-based Eric Blake
2016-07-14 12:15 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-07-15 21:42 ` Eric Blake [this message]
2016-06-22 15:50 ` [Qemu-devel] [PATCH 02/17] block: Convert bdrv_discard() " Eric Blake
2016-07-14 12:15 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 03/17] block: Switch BlockRequest " Eric Blake
2016-07-14 12:15 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-07-14 12:33 ` Eric Blake
2016-06-22 15:51 ` [Qemu-devel] [PATCH 04/17] block: Convert bdrv_aio_discard() " Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 05/17] block: Convert BB interface to byte-based discards Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 06/17] raw-posix: Switch paio_submit() to byte-based Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 07/17] rbd: Switch rbd_start_aio() " Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 08/17] block: Convert .bdrv_aio_discard() " Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 09/17] block: Add .bdrv_co_pdiscard() driver callback Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 10/17] blkreplay: Switch .bdrv_co_discard() to byte-based Eric Blake
2016-07-14 12:16 ` Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 11/17] gluster: " Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 12/17] iscsi: " Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 13/17] nbd: " Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 14/17] qcow2: " Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 15/17] raw_bsd: " Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 16/17] sheepdog: " Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 17/17] block: Kill .bdrv_co_discard() Eric Blake
2016-07-14 12:16 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-07-14 12:30 ` [Qemu-devel] [PATCH 00/17] byte-based block discard Eric Blake
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=578958A8.7000908@redhat.com \
--to=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).