From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Eric Blake <eblake@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/5] Auto-fragment large transactions at the block layer
Date: Tue, 21 Jun 2016 12:43:08 +0200 [thread overview]
Message-ID: <20160621104308.GC4520@noname.redhat.com> (raw)
In-Reply-To: <20160621102357.GG32560@stefanha-x1.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1934 bytes --]
Am 21.06.2016 um 12:23 hat Stefan Hajnoczi geschrieben:
> On Mon, Jun 20, 2016 at 05:39:24PM -0600, Eric Blake wrote:
> > We have max_transfer documented in BlockLimits, but while we
> > honor it during pwrite_zeroes, we were blindly ignoring it
> > during pwritev and preadv, leading to multiple drivers having
> > to implement fragmentation themselves. This series moves
> > fragmentation to the block layer, then fixes the NBD driver to
> > use it; if you like this but it needs a v2, you can request that
> > I further do other drivers (I know at least iscsi and qcow2 do
> > some self-fragmenting and/or error reporting that can be
> > simplified by deferring fragmentation to the block layer).
>
> I'm concerned that requests A & B which should be atomic can now be
> interleaved.
I don't think there is any guarantee of atomicity for overlapping
requests, at least not with more than a single sector (logical block
size, not BDRV_SECTOR_SIZE).
That is, as far as I know neither hardware nor the Linux kernel nor the
qemu block layer (image formats fragment all the time!) protect against
this. If you have concurrent overlapping requests, you always get
undefined behaviour.
> For example, two writes that are overlapping and fragmented.
> Applications expect to either see A or B on disk when both requests have
> completed. Fragmentation must serialize overlapping requests in order
> to prevent interleaved results where the application sees some of A and
> some of B when both requests have completed.
>
> A similar scenario happens when A is a read and B is a write, too. Read
> A is supposed to see either "before B" or "after B". With fragmentation
> it can see "some of before B and some of after B".
If we wanted to achieve this semantics, it would be easy enough: Add a
mark_request_serialising() in the right place. But I'm pretty sure that
this isn't needed.
Kevin
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2016-06-21 10:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 23:39 [Qemu-devel] [PATCH 0/5] Auto-fragment large transactions at the block layer Eric Blake
2016-06-20 23:39 ` [Qemu-devel] [PATCH 1/5] block: Fragment reads to max transfer length Eric Blake
2016-07-08 10:56 ` Kevin Wolf
2016-07-08 14:31 ` Eric Blake
2016-06-20 23:39 ` [Qemu-devel] [PATCH 2/5] block: Fragment writes " Eric Blake
2016-06-20 23:39 ` [Qemu-devel] [PATCH 3/5] raw_bsd: Don't advertise flags not supported by protocol layer Eric Blake
2016-07-08 11:05 ` Kevin Wolf
2016-07-08 14:32 ` Eric Blake
2016-06-20 23:39 ` [Qemu-devel] [PATCH 4/5] nbd: Rely on block layer to break up large requests Eric Blake
2016-06-20 23:39 ` [Qemu-devel] [PATCH 5/5] nbd: Drop unused offset parameter Eric Blake
2016-07-08 11:11 ` Kevin Wolf
2016-06-21 3:19 ` [Qemu-devel] [PATCH 6/5] iscsi: Rely on block layer to break up large requests Eric Blake
2016-06-21 4:17 ` [Qemu-devel] [PATCH 0/5] Auto-fragment large transactions at the block layer Eric Blake
2016-06-21 10:23 ` Stefan Hajnoczi
2016-06-21 10:43 ` Kevin Wolf [this message]
2016-06-22 11:41 ` Stefan Hajnoczi
2016-06-21 22:05 ` Eric Blake
2016-06-22 11:41 ` Stefan Hajnoczi
2016-06-22 5:54 ` Fam Zheng
2016-07-06 2:04 ` Eric Blake
2016-07-08 11:15 ` 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=20160621104308.GC4520@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).