Received: from eggs.gnu.org ([2001:4830:134:3::10]:55324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8mvw-0008D3-PN for qemu-devel@nongnu.org; Mon, 21 Nov 2016 06:38:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8mvv-0006Zc-Jv for qemu-devel@nongnu.org; Mon, 21 Nov 2016 06:38:48 -0500 Date: Mon, 21 Nov 2016 12:38:41 +0100 From: Kevin Wolf Message-ID: <20161121113841.GB5876@noname.redhat.com> References: <1479413642-22463-1-git-send-email-eblake@redhat.com> <1479413642-22463-10-git-send-email-eblake@redhat.com> <9ab3c7b9-c0bb-ab17-b535-07a4a81a043c@redhat.com> <9ca698aa-4127-a326-ffe7-e4ca3a8c03dd@redhat.com> <1f666161-437a-b397-478b-c116a298132e@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2 9/9] tests: Add coverage for recent block geometry fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Eric Blake , qemu-devel@nongnu.org, qemu-block@nongnu.org, pbonzini@redhat.com --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 19.11.2016 um 23:17 hat Max Reitz geschrieben: > On 19.11.2016 22:45, Max Reitz wrote: > > On 18.11.2016 02:28, Eric Blake wrote: > >> On 11/17/2016 05:42 PM, Max Reitz wrote: > >>> On 17.11.2016 21:14, Eric Blake wrote: > >>>> Use blkdebug's new geometry constraints to emulate setups that > >>>> have caused recent regression fixes: write zeroes asserting > >>>> when running through a loopback block device with max-transfer > >>>> smaller than cluster size, and discard rounding away requests > >>>> that were not aligned to power-of-two boundaries. Also, add > >>>> coverage that the block layer is honoring max transfer limits. > >>>> > >>>> For now, a single iotest performs all actions, with the idea > >>>> that we can add future blkdebug constraint test cases in the > >>>> same file; but it can be split into multiple iotests if we find > >>>> reason to run one portion of the test in more setups than what > >>>> are possible in the other. > >>>> > >> > >>> > >>>> +# Dell Equallogic iSCSI device is unusual with its 15M page size > >>>> +echo > >>>> +echo "=3D=3D non-power-of-2 write zeroes =3D=3D" > >>>> + > >>>> +limits=3Dopt-write-zero=3D15M,max-write-zero=3D15M,opt-discard=3D15= M,max-discard=3D15M > >>>> +$QEMU_IO -c "open -o $options,$limits blkdebug::$TEST_IMG" \ > >>>> + -c "write -z 32M 32M" | _filter_qemu_io > >>>> + > >>>> +echo > >>>> +echo "=3D=3D non-power-of-2 discard =3D=3D" > >>>> + > >>>> +limits=3Dopt-write-zero=3D15M,max-write-zero=3D15M,opt-discard=3D15= M,max-discard=3D15M > >>>> +$QEMU_IO -c "open -o $options,$limits blkdebug::$TEST_IMG" \ > >>>> + -c "discard 80000000 30M" | _filter_qemu_io > >>> > >>> Question: What does this test has to do with iscsi? > >>> > >>> The first case just tests that we fall back to writing the head and t= ail > >>> as full zeroes when the driver returns -ENOTSUP. > >> > >> The first one isn't all that interesting, so much as making sure we > >> don't regress. I couldn't make it fail, pre-patch. The real test is t= he > >> second one... > >> > >>> > >>> The second test, as far as I can see, just gives some discard request= to > >>> blkdebug (split up into head, mid and tail), which blkdebug just pass= es > >>> on (because 80000000 is a multiple of 512). qcow2 then discards part = of > >>> that and drops the head and tail of the request it receives (but head > >>> and tail are now calculated based on qcow2's 64k limit). > >> > >> Thanks to the opt-discard=3D15M, the blkdebug layer is forcing the blo= ck > >> layer to break it into head/middle/tail on 15M boundaries, but throwing > >> away the head and tail without giving blkdebug a chance, so it only > >> zeroed 90-105M. Then, with the block layer fixed to pass the head on > >> through anyways, but without patch 2/9, the qcow2 code was seeing that > >> the start offset was not cluster-aligned ($TEST_IMG has 1M clusters), > >> and with patch 4/9 that was making qcow2 return -ENOTSUP, and still > >> ignoring everything up to 90M. It took all of 2, 4, and 5 before the > >> discard finally affected the range 77M-90M (since 80000000 is just > >> before 77M). > >=20 > > OK, thank you for the explanation, but again, I don't know how that is > > related to the iscsi case. >=20 > And now with my last response to patch 5, I do know. So because the > "align" option isn't set, the request_alignment defaults to 512. > blkdebug will accept requests and pass them on even if they're not > aligned to pdiscard_alignment, so that's similar to how iscsi only drops > discard requests that are not aligned to request_alignment but passes > everything on regardless of whether it's aligned to pdiscard_alignment. If the 512 byte alignment is important, please make it explicit. I have a patch to make blkdebug work with byte alignment and then the default will be 1. Kevin --WIyZ46R2i8wDzkSu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJYMtzBAAoJEH8JsnLIjy/W2EEP/isUxOWFeRUr5aR+toxj5mvt 7dDJdz+1wn7bYaHH+JlXZg112A3HalbgSEub/HRsFYheM5O+CP7YpC3dDJWf3M6z LeMRGQeJ1q8gz8RLd9Us+xGnRopyrQPrRPHXTnHSdYTT7TDKI6ZCCghCt6Yv/HKM 0AwpbnfcTKUURvfIB6YQsDG466eEYg3g6BHEHMfUyxqA8tYC3d2ArZE8VnRy9lXJ 3yW4tWtIMb86btOzvC9VxUMbLrCt+owxrAjK+J3g4S7pl06YDkp5OOWt+r/VwoYR Jt32Ecovu2U/aDJagEyf5P5KImRzRvlsn8GnP9KTrLLNRFnDZuqDy4PPGcOfFSz4 FtgzUSJK5M4qYM1ob/0kc/Z5nh5VDxJZ8ERQG1iz0LP25C2MQPMM+7KfKaWSEKUR 75b+XHJ9MEYanEP+xq5ZLLs0zpIRFq1M4gzypwE9Er/WQ3DbWk2lS/1MYCniAzpk c8/ngmcm8Tsnzm8T+rxrXB5zsarldQbUBHSJjo6ovT4sYT7ZaG5QHqBYnhedxjhx CE+sHdFLGBn2DQB5gr1BfakDoUphq+uVKIbjRzOZYJq65oR+roGj7Ee8rfWfXKPv M2U9N8UQdm9DZP2Ot2MJzYqTITu18bxB0LbpY6fQ3qTt7+OZykHSXnd8Inq1njt/ L6HNsTmNYhN0iXkATbLB =tP5q -----END PGP SIGNATURE----- --WIyZ46R2i8wDzkSu--