From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2nUp-0001fB-6F for qemu-devel@nongnu.org; Fri, 26 Jul 2013 15:16:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2nUn-0001yw-66 for qemu-devel@nongnu.org; Fri, 26 Jul 2013 15:16:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2nUm-0001xw-So for qemu-devel@nongnu.org; Fri, 26 Jul 2013 15:16:09 -0400 Message-ID: <51F2CAF4.40103@redhat.com> Date: Fri, 26 Jul 2013 13:16:04 -0600 From: Eric Blake MIME-Version: 1.0 References: <1374596968-20181-1-git-send-email-benoit@irqsave.net> <1374596968-20181-2-git-send-email-benoit@irqsave.net> In-Reply-To: <1374596968-20181-2-git-send-email-benoit@irqsave.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="X6gfL9dCeSxdbH0kxFMBgBoQ0xW7JvPKu" Subject: Re: [Qemu-devel] [PATCH V3 for-1.6 1/5] block: Repair the throttling code. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --X6gfL9dCeSxdbH0kxFMBgBoQ0xW7JvPKu Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/23/2013 10:29 AM, Beno=C3=AEt Canet wrote: > The throttling code was segfaulting since commit > 02ffb504485f0920cfc75a0982a602f824a9a4f4 because some qemu_co_queue_nex= t caller > does not run in a coroutine. > qemu_co_queue_do_restart assume that the caller is a coroutinne. s/assume/assumes/; s/coroutinne/coroutine/ > As suggested by Stefan fix this by entering the coroutine directly. > Also make sure like suggested that qemu_co_queue_next() and > qemu_co_queue_restart_all() can be called only in coroutines. >=20 > Signed-off-by: Benoit Canet > --- > block.c | 8 ++++---- > include/block/coroutine.h | 9 +++++++-- > qemu-coroutine-lock.c | 20 ++++++++++++++++++-- > 3 files changed, 29 insertions(+), 8 deletions(-) >=20 > diff --git a/block.c b/block.c > index b560241..dc72643 100644 > --- a/block.c > +++ b/block.c > @@ -127,7 +127,8 @@ void bdrv_io_limits_disable(BlockDriverState *bs) > { > bs->io_limits_enabled =3D false; > =20 > - while (qemu_co_queue_next(&bs->throttled_reqs)); > + while (qemu_co_enter_next(&bs->throttled_reqs)) { > + } On first read, I missed the s/queue/enter/ change and thought all you were doing was the s/;/{}/ change. Is the style change necessary to keep checkpatch.pl happy? If not, then keeping the old style would draw better attention to the bug fix. This patch is worth 1.6, even if the rest of the series is not. I'm not a coroutine expert, so take this with a grain of salt: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --X6gfL9dCeSxdbH0kxFMBgBoQ0xW7JvPKu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR8sr0AAoJEKeha0olJ0NqiykH/3mp5QuNlxm6vvFONcnNQr/C zLHXK/u1RMN/NqGvKQHpXtkin42ZiYiQ0+by6XNQ6EoV0H9VgVmkGVxRcZsDwogR sc33dL20KFUG2BDX+liBp7kZa9X1hNsfYrYoMQMH0OPP2S2AuS/4H5kKPpcZ09VI RVn1rZT+xC4G2cWdjeTX7wvpBfZtsad2OmJSE7jXWfEfW1ET6B79ed1qkiiROMHv yzGkQ6OrVISxqveGT+//Dqr4Ylm5e1M9NklhZLkWxXPjdxCcn+3SMmQeiFDB95hE J19YRsdLzLipEu94jPSkHRybf8ls2WGplXGgVT15HWMDTKK9Jal0WEmPBPyFjqM= =IA4I -----END PGP SIGNATURE----- --X6gfL9dCeSxdbH0kxFMBgBoQ0xW7JvPKu--