Received: from eggs.gnu.org ([2001:4830:134:3::10]:38694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFgX8-0004mE-IZ for qemu-devel@nongnu.org; Wed, 22 Jun 2016 07:41:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFgX4-0000YR-93 for qemu-devel@nongnu.org; Wed, 22 Jun 2016 07:41:25 -0400 Date: Wed, 22 Jun 2016 12:41:19 +0100 From: Stefan Hajnoczi Message-ID: <20160622114119.GD11330@stefanha-x1.localdomain> References: <1466465969-25315-1-git-send-email-eblake@redhat.com> <20160621102357.GG32560@stefanha-x1.localdomain> <20160621104308.GC4520@noname.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hxkXGo8AKqTJ+9QI" Content-Disposition: inline In-Reply-To: <20160621104308.GC4520@noname.redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/5] Auto-fragment large transactions at the block layer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Eric Blake , qemu-devel@nongnu.org, qemu-block@nongnu.org --hxkXGo8AKqTJ+9QI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 21, 2016 at 12:43:08PM +0200, Kevin Wolf wrote: > 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). > >=20 > > I'm concerned that requests A & B which should be atomic can now be > > interleaved. >=20 > 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). >=20 > 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. Kevin, I think you are right and my mental model was wrong. I spent some time looking at SCSI SAM and SBC documents. The closest information I found was SBC "4.27 Model for uninterrupted sequences on LBA ranges" where ORWRITE, XDWRITEREAD, XPWRITE, and COMPARE AND WRITE are singled out. It implies that the device server may access LBAs while other types of commands are executing. If anyone knows a better reference in the SCSI specifications that clarifies behavior of overlapping I/O requests, please share! Stefan --hxkXGo8AKqTJ+9QI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJXanlfAAoJEJykq7OBq3PI6GUIAKNIHNJr+Nht4gXv8RR1i1vC eJTg8hnzYdVSYjkEMYhCcDtbLGvBjzq+AB+k1P7sttNKFwFJzzn9DdwSTHB/pgCK N/sJp1GVnkCbZXLWH8lBfe1e9g7jrB9yOBDX4d8I/nvZI2/P5PO3AfQ9OCQOZ/a5 eLmm8KjJS+wGgozFgMCVq7iMlz84tXpULJ1AYCNXXBCIjcR6AB/4pGIYW0j3I0XU sfHwVYASVPampSVId8pxXrgBt8uvft8+J/aC8eQ0n4cdt7BIOKshxn5ewipiY0e1 sZPzm+yG5pposXwF05fcKegz2NO3+nsXnIHGZ0YlYZ7+L1pyFe1K/vZvUMPywPc= =hgga -----END PGP SIGNATURE----- --hxkXGo8AKqTJ+9QI--