From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKcLz-0004dZ-H1 for qemu-devel@nongnu.org; Tue, 05 Jul 2016 22:14:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKcLx-0001DP-F2 for qemu-devel@nongnu.org; Tue, 05 Jul 2016 22:14:18 -0400 References: <1467733852-27097-1-git-send-email-kwolf@redhat.com> <1467733852-27097-19-git-send-email-kwolf@redhat.com> From: Eric Blake Message-ID: <577C6970.4070907@redhat.com> Date: Tue, 5 Jul 2016 20:14:08 -0600 MIME-Version: 1.0 In-Reply-To: <1467733852-27097-19-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WGjXTp9i96FIQT89FCm4wJWUwMsJsAQKV" Subject: Re: [Qemu-devel] [PULL 18/43] block: Switch discard length bounds to byte-based List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WGjXTp9i96FIQT89FCm4wJWUwMsJsAQKV From: Eric Blake To: Kevin Wolf , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org Message-ID: <577C6970.4070907@redhat.com> Subject: Re: [Qemu-devel] [PULL 18/43] block: Switch discard length bounds to byte-based References: <1467733852-27097-1-git-send-email-kwolf@redhat.com> <1467733852-27097-19-git-send-email-kwolf@redhat.com> In-Reply-To: <1467733852-27097-19-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/05/2016 09:50 AM, Kevin Wolf wrote: > From: Eric Blake >=20 > Sector-based limits are awkward to think about; in our on-going > quest to move to byte-based interfaces, convert max_discard and > discard_alignment. Rename them, using 'pdiscard' as an aid to > track which remaining discard interfaces need conversion, and so > that the compiler will help us catch the change in semantics > across any rebased code. The BlockLimits type is now completely > byte-based; and in iscsi.c, sector_limits_lun2qemu() is no > longer needed. >=20 > +++ b/include/block/block_int.h > @@ -324,11 +324,17 @@ struct BlockDriver { > }; > =20 > typedef struct BlockLimits { > - /* maximum number of sectors that can be discarded at once */ > - int max_discard; > - > - /* optimal alignment for discard requests in sectors */ > - int64_t discard_alignment; > + /* maximum number of bytes that can be discarded at once (since it= > + * is signed, it must be < 2G, if set), should be multiple of > + * pdiscard_alignment, but need not be power of 2. May be 0 if no > + * inherent 32-bit limit */ > + int32_t max_pdiscard; > + > + /* optimal alignment for discard requests in bytes, must be power > + * of 2, less than max_pdiscard if that is set, and multiple of > + * bs->request_alignment. May be 0 if bs->request_alignment is > + * good enough */ > + uint32_t pdiscard_alignment; Given the recent thread on an iscsi device with 15M optimum alignment for zero and discards, I guess I have some followup patches to write if we don't want to stall this pull request. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --WGjXTp9i96FIQT89FCm4wJWUwMsJsAQKV 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/ iQEcBAEBCAAGBQJXfGlwAAoJEKeha0olJ0NqQnMH/2cfGBc3NrwJMU6u9WURxUc5 J9HR+jZr/mcgL/+R2GAbsjMZW/iI/SyxLxr8kQ22vpVv5mBH0rsuJP/We5dzJDPc DGIeSoy9Nb5znb4R8BnkKibHJw5byr/Vs1OjCJcjMQHGrb/WSeWKbFAQW7aVJzuT A2kEKuMvqepogv6fXmflpLMCDwRNOZIlf0FnRgcApk7tqPpP+CcXCevcjCMNKzMC e0++SOrdEobwNsBsL6s06G+XWaO6FVV3AYe8KZVoMweBqXzG7Q/mrCSIyxMecBFw 7m8LQCNvhK34gvHpiTIiv7lAEWjJNQJOlsaQC8sdt4EO3+H7kXZptInOBuc23cI= =Q871 -----END PGP SIGNATURE----- --WGjXTp9i96FIQT89FCm4wJWUwMsJsAQKV--