From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOAs6-0001xf-Mc for qemu-devel@nongnu.org; Fri, 15 Jul 2016 17:42:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOAs5-0003jJ-S7 for qemu-devel@nongnu.org; Fri, 15 Jul 2016 17:42:10 -0400 References: <1466610674-23157-1-git-send-email-eblake@redhat.com> <1466610674-23157-2-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <578958A8.7000908@redhat.com> Date: Fri, 15 Jul 2016 15:42:00 -0600 MIME-Version: 1.0 In-Reply-To: <1466610674-23157-2-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gx7pWsn6FdVIq3529c0u8sRxMd6saoTbp" Subject: Re: [Qemu-devel] [PATCH 01/17] block: Convert bdrv_co_discard() to byte-based List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Max Reitz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gx7pWsn6FdVIq3529c0u8sRxMd6saoTbp From: Eric Blake To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Max Reitz Message-ID: <578958A8.7000908@redhat.com> Subject: Re: [Qemu-devel] [PATCH 01/17] block: Convert bdrv_co_discard() to byte-based References: <1466610674-23157-1-git-send-email-eblake@redhat.com> <1466610674-23157-2-git-send-email-eblake@redhat.com> In-Reply-To: <1466610674-23157-2-git-send-email-eblake@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/22/2016 09:50 AM, Eric Blake wrote: > Another step towards byte-based interfaces everywhere. Replace > the sector-based bdrv_co_discard() with a new byte-based > bdrv_co_pdiscard(), which silently ignores any unaligned head > or tail. Driver callbacks will be converted in followup patches. >=20 > By calculating the alignment outside of the loop, and clamping > the max discard to an aligned value, we can simplify the actions > done within the loop. >=20 > Signed-off-by: Eric Blake > --- > +++ b/block/io.c > +int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset= , > + int count) > - tracked_request_begin(&req, bs, sector_num << BDRV_SECTOR_BITS, > - nb_sectors << BDRV_SECTOR_BITS, BDRV_TRACKED= _DISCARD); > + /* Discard is advisory, so ignore any unaligned head or tail */ > + align =3D MAX(BDRV_SECTOR_SIZE, > + MAX(bs->bl.pdiscard_alignment, bs->bl.request_alignmen= t)); > + assert(is_power_of_2(align)); And this further ingrains the already existing problem with iscsi devices that advertise 15M for discard alignment. Is it more important for me to fix that regression first then base this series on top of that, or is it acceptable for me to repost this series and then work on the regression fix? I'd prefer the latter course of action, as a regression fix is good material for post-hardfreeze. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --gx7pWsn6FdVIq3529c0u8sRxMd6saoTbp 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/ iQEcBAEBCAAGBQJXiVipAAoJEKeha0olJ0NqB+0IAKy1mDfaI/bIegifWizqBs7f v+UsUFO/VeAWmxwo+t2GbaU32XjKoGN31eIbWoxJXfIAMCZxo6QFNNdY+nmTh+/k 4GDmvC97MVIXdwU7HP5ZfH4GD/PMxgYyvIm0KBU3MnouR4x0Awq880J5kI0FnPcH nqdOH0DVTiZzJbuzjOhzuqAVlqgpcH1CNwjGqUexss5MAB3i4RVjyUWm8w+S/JfH DzHnWaV2F3C82DDueDLEwUTWQPI23289Hd/CKKitldcX4QGrvdcH8ObabbyamTnm 8Gyw9jUAFNn+jFsmPcPQNmLakB57XBiJ6lJfxLSKw/QYSgrHkNXlU3c5c3ya5+A= =ihG9 -----END PGP SIGNATURE----- --gx7pWsn6FdVIq3529c0u8sRxMd6saoTbp--