Received: from eggs.gnu.org ([2001:4830:134:3::10]:39832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7XkG-0007ej-AH for qemu-devel@nongnu.org; Thu, 17 Nov 2016 20:13:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7XkF-00060A-7Z for qemu-devel@nongnu.org; Thu, 17 Nov 2016 20:13:36 -0500 References: <1479413642-22463-1-git-send-email-eblake@redhat.com> <1479413642-22463-6-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: Date: Thu, 17 Nov 2016 19:13:27 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="D9WX8Odvb2q9EATtlGgqnG4pkLA3Gja1h" Subject: Re: [Qemu-devel] [PATCH v2 5/9] block: Pass unaligned discard requests to drivers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com, pbonzini@redhat.com, qemu-stable@nongnu.org, Stefan Hajnoczi , Fam Zheng , Peter Lieven This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --D9WX8Odvb2q9EATtlGgqnG4pkLA3Gja1h From: Eric Blake To: Max Reitz , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com, pbonzini@redhat.com, qemu-stable@nongnu.org, Stefan Hajnoczi , Fam Zheng , Peter Lieven Message-ID: Subject: Re: [PATCH v2 5/9] block: Pass unaligned discard requests to drivers References: <1479413642-22463-1-git-send-email-eblake@redhat.com> <1479413642-22463-6-git-send-email-eblake@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/17/2016 05:44 PM, Max Reitz wrote: >> >> Since the SCSI specification says nothing about a minimum >> discard granularity, and only documents the preferred >> alignment, it is best if the block layer gives the driver >> every bit of information about discard requests, rather than >> rounding it to alignment boundaries early. >=20 > Is this series supposed to address this issue? Because if so, I fail to= > see where it does. If the device advertises 15 MB as the discard > granularity, then the iscsi driver will still drop all discard requests= > that are not aligned to 15 MB boundaries, no? >=20 I don't have access to the device in question, so I'm hoping Peter chimes in (oops, how'd I miss him on original CC?). Here's all the more he said on v1: https://lists.gnu.org/archive/html/qemu-devel/2016-11/msg02223.html My gut feel, however, is that the iscsi code is NOT rounding (the qcow2 code rounded, but that's different); the regression happened in 2.7 because the block layer also started rounding, and this patch gets the block layer rounding out of the way. If nothing changed in the iscsi code in the meantime, then the iscsi code should now (once again) be discarding all sizes, regardless of the 15M advertisement. Meanwhile, I _did_ test this patch with blkdebug (see 9/9), as well as on a slightly modified NBD client that forced 15M alignments, and for those cases, it definitely made the difference on whether all bytes were passed (spread across several calls), vs. just the aligned bytes in the middle of a request larger than 15M. > The only difference is that it's now the iscsi driver that drops the > request instead of the generic block layer. If the iscsi driver was ever dropping it in the first place. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --D9WX8Odvb2q9EATtlGgqnG4pkLA3Gja1h 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/ iQEcBAEBCAAGBQJYLlW3AAoJEKeha0olJ0Nq67EH/iItef+QoY80zc5iYuuzpLT5 Gz5YQeUXwGdJI9WvEcalGIQjx2gvt1GUon3WT+T8o2E+/bvPTGJ3ezUY/mGpLktl Z9m2P7ZTntSxjdtz1n2kjvtiRoZJjxNJB2DlYMJUvOk/Khi8i56Rt1+6ZgZt9x0Z sfk/wxtl6g2jpd2xqQWlo0TOcbyWdbkd7T8Q0Ule44k7mKIi42N0vG4My+c+/7+I yiNTyggH48U0HJxC0c+eWy4s/I20Rn8msyAArC6wRO56gqKg18KPgesUmlTb9dJm hmGDWUf6h+jt17FSuY9/LiRLSqk2nQ0ZuH6o8nsbSQJMUIrjDy90JM7+3CerMwo= =N0DJ -----END PGP SIGNATURE----- --D9WX8Odvb2q9EATtlGgqnG4pkLA3Gja1h--