Received: from eggs.gnu.org ([2001:4830:134:3::10]:54750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7WLm-00045T-Qs for qemu-devel@nongnu.org; Thu, 17 Nov 2016 18:44:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7WLl-0000a9-T0 for qemu-devel@nongnu.org; Thu, 17 Nov 2016 18:44:14 -0500 References: <1479413642-22463-1-git-send-email-eblake@redhat.com> <1479413642-22463-6-git-send-email-eblake@redhat.com> From: Max Reitz Message-ID: Date: Fri, 18 Nov 2016 00:44:03 +0100 MIME-Version: 1.0 In-Reply-To: <1479413642-22463-6-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wNoMomqPLtJgRaeJkxDtco2C6Ih2b8I5X" 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: Eric Blake , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com, pbonzini@redhat.com, qemu-stable@nongnu.org, Stefan Hajnoczi , Fam Zheng This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wNoMomqPLtJgRaeJkxDtco2C6Ih2b8I5X From: Max Reitz To: Eric Blake , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com, pbonzini@redhat.com, qemu-stable@nongnu.org, Stefan Hajnoczi , Fam Zheng 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: <1479413642-22463-6-git-send-email-eblake@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 17.11.2016 21:13, Eric Blake wrote: > Discard is advisory, so rounding the requests to alignment > boundaries is never semantically wrong from the data that > the guest sees. But at least the Dell Equallogic iSCSI SANs > has an interesting property that its advertised discard > alignment is 15M, yet documents that discarding a sequence > of 1M slices will eventually result in the 15M page being > marked as discarded, and it is possible to observe which > pages have been discarded. >=20 > Between commits 9f1963b and b8d0a980, we converted the block > layer to a byte-based interface that ultimately ignores any > unaligned head or tail based on the driver's advertised > discard granularity, which means that qemu 2.7 refuses to > pass any discard request smaller than 15M down to the Dell > Equallogic hardware. This is a slight regression in behavior > compared to earlier qemu, where a guest executing discards > in power-of-2 chunks used to be able to get every page > discarded, but is now left with various pages still allocated > because the guest requests did not align with the hardware's > 15M pages. >=20 > 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. 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? The only difference is that it's now the iscsi driver that drops the request instead of the generic block layer. Max --wNoMomqPLtJgRaeJkxDtco2C6Ih2b8I5X Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJYLkDDEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQBFh CAC8sk5nVMMfCw+44oeSAyzrpAtrBeWP7EFKECpP3YBocS59k8F5WbZZSjYmWitI Oid5QZhVXbJc+drvJKxTzc50vdxzJzJBNsKBmU3goyU+ka6gYFWXIM12zWQCmYlU ssDZ1Cv7R+cAlLkKAIT7HtQjVWbaFFLd89y5CxvzPduieomZSbjPJz5gQCCXtVq0 3F6HtgBuCxNm9aQZYVKYbfTIqFyASniJOj94fgm7aILzKDIn268FBPFSs7iY0e96 bDxkmmC9DxhP7tRdrnI5EWt1DR0Vn8KyCAKymvjIpsaXhP/LTCgDUTmY/f4PqbQ1 uEelE13FZXK3PvXwG4H8JQv/ =G2Yq -----END PGP SIGNATURE----- --wNoMomqPLtJgRaeJkxDtco2C6Ih2b8I5X--