From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Olaf Hering <olaf@aepfle.de>,
"open list:X86" <xen-devel@lists.xensource.com>,
qemu-block@nongnu.org,
"open list:All patches CC here" <qemu-devel@nongnu.org>,
Max Reitz <mreitz@redhat.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Anthony Perard <anthony.perard@citrix.com>
Subject: Re: [Qemu-devel] [PATCH] xen_disk: convert discard input to byte ranges
Date: Fri, 18 Nov 2016 16:38:50 +0100 [thread overview]
Message-ID: <20161118153850.GB4694@noname.redhat.com> (raw)
In-Reply-To: <3b7a53ed-10e1-e733-7454-d5ee38761da0@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1821 bytes --]
Am 18.11.2016 um 15:35 hat Eric Blake geschrieben:
> On 11/18/2016 08:19 AM, Olaf Hering wrote:
> > Am 18. November 2016 14:43:18 MEZ, schrieb Eric Blake <eblake@redhat.com>:
> >> On 11/18/2016 04:24 AM, Olaf Hering wrote:
> >>> The guest sends discard requests as u64 sector/count pairs, but the
> >>> block layer operates internally with s64/s32 pairs. The conversion
> >>> leads to IO errors in the guest, the discard request is not
> >> processed.
> >>
> >> Doesn't the block layer already split discard requests into 2^31 byte
> >> chunks?
> >
> > How would it do that without valid input? It was wrong before the sectors to bytes conversion, and now its even worse given that all the world fits into an int.
>
> Then it sounds like the real bug is that the block layer
> bdrv_co_pdiscard() is buggy for taking 'int count' instead of 'uint64_t
> count'. Eventually, I think the entire block layer should be fixed to
> allow 64-bit count everywhere, and then auto-fragment it back down to 31
> bits (or even smaller, like NBD's 32M limit or Linux loopback device 64k
> limit) as needed, rather than making all the backends reimplement
> fragmentation.
>
> >
> > Remember that there is no API to let the guest know about the limitations of the host.
>
> Correct. But the goal of the block layer is to hide the quirks, so that
> the code handling the guest requests can offload all the common work to
> one place.
>
> Kevin, is it too late for 2.8 for patches that change bdrv_co_pdiscard
> to take a 64-bit count? Or would that still be under bug-fix category
> because of the xen use case?
Given that we're already a few weeks into the freeze, I would very much
prefer an isolated patch for xen_disk for 2.8, and then it can be
cleaned up during the 2.9 cycle.
Kevin
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2016-11-18 15:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 10:24 [PATCH] xen_disk: convert discard input to byte ranges Olaf Hering
2016-11-18 10:30 ` Olaf Hering
2016-11-23 10:49 ` Olaf Hering
2016-11-23 11:02 ` Olaf Hering
2016-11-23 18:51 ` Stefano Stabellini
2016-11-18 13:43 ` [Qemu-devel] " Eric Blake
2016-11-18 14:19 ` Olaf Hering
2016-11-18 14:35 ` Eric Blake
2016-11-18 15:38 ` Kevin Wolf [this message]
2016-11-18 16:39 ` Eric Blake
2016-11-18 17:41 ` Olaf Hering
2016-11-18 18:50 ` Eric Blake
2016-11-22 16:12 ` Olaf Hering
2016-11-22 16:32 ` Eric Blake
2016-11-22 17:00 ` Olaf Hering
2016-11-22 17:11 ` 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=20161118153850.GB4694@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=anthony.perard@citrix.com \
--cc=eblake@redhat.com \
--cc=mreitz@redhat.com \
--cc=olaf@aepfle.de \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xensource.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).