From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFTnZ-0000oT-6r for qemu-devel@nongnu.org; Tue, 21 Jun 2016 18:05:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFTnW-0005Cl-QO for qemu-devel@nongnu.org; Tue, 21 Jun 2016 18:05:32 -0400 References: <1466465969-25315-1-git-send-email-eblake@redhat.com> <20160621102357.GG32560@stefanha-x1.localdomain> From: Eric Blake Message-ID: <5769BA22.4060508@redhat.com> Date: Tue, 21 Jun 2016 16:05:22 -0600 MIME-Version: 1.0 In-Reply-To: <20160621102357.GG32560@stefanha-x1.localdomain> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pxBScRbjP7xO9T26nwFXBRFrQlpUoI2c9" 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: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, kwolf@redhat.com, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pxBScRbjP7xO9T26nwFXBRFrQlpUoI2c9 From: Eric Blake To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, kwolf@redhat.com, qemu-block@nongnu.org Message-ID: <5769BA22.4060508@redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/5] Auto-fragment large transactions at the block layer References: <1466465969-25315-1-git-send-email-eblake@redhat.com> <20160621102357.GG32560@stefanha-x1.localdomain> In-Reply-To: <20160621102357.GG32560@stefanha-x1.localdomain> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/21/2016 04:23 AM, Stefan Hajnoczi wrote: > 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. >=20 > For example, two writes that are overlapping and fragmented. > Applications expect to either see A or B on disk when both requests hav= e > 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. >=20 > A similar scenario happens when A is a read and B is a write, too. Rea= d > A is supposed to see either "before B" or "after B". With fragmentatio= n > it can see "some of before B and some of after B". This patch series doesn't change that, it just changes where the atomicity is broken. Consider that pre-patch, a raw format wrapping an NBD protocol connection would see a 32M max_transfer, but we were not fragmenting at the raw protocol. Thus, if someone requests a 40M operation, the raw protocol treats it as a single transaction, and NBD then fragments it into two transactions over the wire; and NBD can complete transactions out of order. All this series does is move the fragmentation to the raw layer, rather than the NBD layer, but the race between overlapping oversize requests is present whether or not the series is applied. >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --pxBScRbjP7xO9T26nwFXBRFrQlpUoI2c9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXaboiAAoJEKeha0olJ0NqDGMH/03HsKnEoeVtqOKeNxsNXv4N udKLHl41pJyr4shQ3QzzAtzeW8QAEOylpvec8Xa6dTNlralSqtHiBs+0pEBoDrtL Uix1FIIsyt32MEA7q+MdvY/z21ron7GW0on2Uf4Tp6lLe7JzOnjfeIJFvUax1udi 4ld2dNiZv+UIa0Hh/2lCyudGv5oBQQ65EoeP7O9UIiOnuEJ0DTNhtSIuQN9XvvAS mBF2n11dfkGkF5iYsfhFiOk3T2PLGhUyE5PEt+PyrS75TJUrErevibC52KplMa5c s1nuAuk8gUmlmSi5BYYpTAc46V6CrZaRbyUa9T2YiPeJdi2CUcV9Tx5A0hpMSf0= =tZ0c -----END PGP SIGNATURE----- --pxBScRbjP7xO9T26nwFXBRFrQlpUoI2c9--