[{"id":1771984,"web_url":"http://patchwork.ozlabs.org/comment/1771984/","msgid":"<20170920142816.GE9409@stefanha-x1.localdomain>","list_archive_url":null,"date":"2017-09-20T14:28:16","subject":"Re: [Qemu-devel] [PATCH 1/3] block: add bdrv_co_drain_end callback","submitter":{"id":17227,"url":"http://patchwork.ozlabs.org/api/people/17227/","name":"Stefan Hajnoczi","email":"stefanha@redhat.com"},"content":"On Wed, Sep 20, 2017 at 01:23:09PM +0300, Manos Pitsidianakis wrote:\n> diff --git a/include/block/block_int.h b/include/block/block_int.h\n> index ba4c383393..ea1326e3c7 100644\n> --- a/include/block/block_int.h\n> +++ b/include/block/block_int.h\n> @@ -359,6 +359,8 @@ struct BlockDriver {\n>       */\n>      void coroutine_fn (*bdrv_co_drain)(BlockDriverState *bs);\n>  \n> +    void coroutine_fn (*bdrv_co_drain_end)(BlockDriverState *bs);\n\nPlease update the doc comment to describe the environment under which\nbegin() and end() are invoked.  It should be clear when to implement\nbegin() and/or end().","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=stefanha@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xy3X16bndz9s8J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 01:27:29 +1000 (AEST)","from localhost ([::1]:48849 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1duguL-0004jJ-Kk\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 11:27:25 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60278)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <stefanha@redhat.com>) id 1dufzL-0008Ti-Ah\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:28:37 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <stefanha@redhat.com>) id 1dufzK-0002Rp-GA\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:28:31 -0400","from mx1.redhat.com ([209.132.183.28]:34844)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <stefanha@redhat.com>)\n\tid 1dufzG-0002QF-6o; Wed, 20 Sep 2017 10:28:26 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 3FFD88765D;\n\tWed, 20 Sep 2017 14:28:25 +0000 (UTC)","from localhost (ovpn-117-27.ams2.redhat.com [10.36.117.27])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 6E7DC65E91;\n\tWed, 20 Sep 2017 14:28:17 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 3FFD88765D","Date":"Wed, 20 Sep 2017 15:28:16 +0100","From":"Stefan Hajnoczi <stefanha@redhat.com>","To":"Manos Pitsidianakis <el13635@mail.ntua.gr>","Message-ID":"<20170920142816.GE9409@stefanha-x1.localdomain>","References":"<20170920102311.25736-1-el13635@mail.ntua.gr>\n\t<20170920102311.25736-2-el13635@mail.ntua.gr>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170920102311.25736-2-el13635@mail.ntua.gr>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tWed, 20 Sep 2017 14:28:25 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] block: add bdrv_co_drain_end callback","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,\n\tqemu-devel <qemu-devel@nongnu.org>, qemu-block <qemu-block@nongnu.org>,\n\tMax Reitz <mreitz@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1772008,"web_url":"http://patchwork.ozlabs.org/comment/1772008/","msgid":"<20170920142632.GC9409@stefanha-x1.localdomain>","list_archive_url":null,"date":"2017-09-20T14:26:32","subject":"Re: [Qemu-devel] [PATCH 1/3] block: add bdrv_co_drain_end callback","submitter":{"id":17227,"url":"http://patchwork.ozlabs.org/api/people/17227/","name":"Stefan Hajnoczi","email":"stefanha@redhat.com"},"content":"On Wed, Sep 20, 2017 at 01:23:09PM +0300, Manos Pitsidianakis wrote:\n> @@ -188,7 +194,7 @@ static bool bdrv_drain_recurse(BlockDriverState *bs)\n>      waited = BDRV_POLL_WHILE(bs, atomic_read(&bs->in_flight) > 0);\n>  \n>      /* Ensure any pending metadata writes are submitted to bs->file.  */\n> -    bdrv_drain_invoke(bs);\n> +    bdrv_drain_invoke(bs, begin);\n\nDo you need to move bdrv_drain_invoke(bs, begin) before\nBDRV_POLL_WHILE(bs, atomic_read(&bs->in_flight) > 0)?\n\nThis will ensure that throttling is disabled and the TGM restarted\nbefore we wait for requests to complete.\n\nStefan","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=stefanha@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xy45K0fCxz9t2Q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 01:52:53 +1000 (AEST)","from localhost ([::1]:49094 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1duhIx-0000oj-47\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 11:52:51 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:59814)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <stefanha@redhat.com>) id 1dufxb-0006Fo-8P\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:26:44 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <stefanha@redhat.com>) id 1dufxX-0001L1-Fc\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:26:43 -0400","from mx1.redhat.com ([209.132.183.28]:47758)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <stefanha@redhat.com>)\n\tid 1dufxT-0001IZ-CO; Wed, 20 Sep 2017 10:26:35 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 6D17881DF7;\n\tWed, 20 Sep 2017 14:26:34 +0000 (UTC)","from localhost (ovpn-117-27.ams2.redhat.com [10.36.117.27])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 7F1F95D6A3;\n\tWed, 20 Sep 2017 14:26:33 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 6D17881DF7","Date":"Wed, 20 Sep 2017 15:26:32 +0100","From":"Stefan Hajnoczi <stefanha@redhat.com>","To":"Manos Pitsidianakis <el13635@mail.ntua.gr>","Message-ID":"<20170920142632.GC9409@stefanha-x1.localdomain>","References":"<20170920102311.25736-1-el13635@mail.ntua.gr>\n\t<20170920102311.25736-2-el13635@mail.ntua.gr>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170920102311.25736-2-el13635@mail.ntua.gr>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tWed, 20 Sep 2017 14:26:34 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 1/3] block: add bdrv_co_drain_end callback","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,\n\tqemu-devel <qemu-devel@nongnu.org>, qemu-block <qemu-block@nongnu.org>,\n\tMax Reitz <mreitz@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1772102,"web_url":"http://patchwork.ozlabs.org/comment/1772102/","msgid":"<20170920173210.ftursp2syk2vm3j5@postretch>","list_archive_url":null,"date":"2017-09-20T17:32:10","subject":"Re: [Qemu-devel] [PATCH 1/3] block: add bdrv_co_drain_end callback","submitter":{"id":71571,"url":"http://patchwork.ozlabs.org/api/people/71571/","name":"Manos Pitsidianakis","email":"el13635@mail.ntua.gr"},"content":"On Wed, Sep 20, 2017 at 03:26:32PM +0100, Stefan Hajnoczi wrote:\n>On Wed, Sep 20, 2017 at 01:23:09PM +0300, Manos Pitsidianakis wrote:\n>> @@ -188,7 +194,7 @@ static bool bdrv_drain_recurse(BlockDriverState *bs)\n>>      waited = BDRV_POLL_WHILE(bs, atomic_read(&bs->in_flight) > 0);\n>>\n>>      /* Ensure any pending metadata writes are submitted to bs->file.  */\n>> -    bdrv_drain_invoke(bs);\n>> +    bdrv_drain_invoke(bs, begin);\n>\n>Do you need to move bdrv_drain_invoke(bs, begin) before\n>BDRV_POLL_WHILE(bs, atomic_read(&bs->in_flight) > 0)?\n>\n>This will ensure that throttling is disabled and the TGM restarted\n>before we wait for requests to complete.\n>\n\nHm yes. Before, the order was irrelevant because BlockBackend issued the \ndrain first by restarting the tgm in blk_root_drained_begin.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xy6JX5q5mz9s0g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 03:32:44 +1000 (AEST)","from localhost ([::1]:49939 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1duira-0000LE-Vi\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 13:32:43 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56160)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <el13635@mail.ntua.gr>) id 1duirD-0000IK-Tt\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 13:32:20 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <el13635@mail.ntua.gr>) id 1duirD-00049c-7S\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 13:32:19 -0400","from smtp1.ntua.gr ([2001:648:2000:de::183]:32833)\n\tby eggs.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <el13635@mail.ntua.gr>)\n\tid 1duir8-00044U-NK; Wed, 20 Sep 2017 13:32:15 -0400","from mail.ntua.gr (carp0.noc.ntua.gr [147.102.222.60])\n\t(authenticated bits=0)\n\tby smtp1.ntua.gr (8.15.2/8.15.2) with ESMTPSA id v8KHWBJV093914\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=NOT); Wed, 20 Sep 2017 20:32:11 +0300 (EEST)\n\t(envelope-from el13635@mail.ntua.gr)"],"X-Authentication-Warning":"smtp1.ntua.gr: Host carp0.noc.ntua.gr\n\t[147.102.222.60] claimed to be mail.ntua.gr","Date":"Wed, 20 Sep 2017 20:32:10 +0300","From":"Manos Pitsidianakis <el13635@mail.ntua.gr>","To":"Stefan Hajnoczi <stefanha@redhat.com>","Message-ID":"<20170920173210.ftursp2syk2vm3j5@postretch>","Mail-Followup-To":"Manos Pitsidianakis <el13635@mail.ntua.gr>,\n\tStefan Hajnoczi <stefanha@redhat.com>,\n\tqemu-devel <qemu-devel@nongnu.org>,\n\tqemu-block <qemu-block@nongnu.org>, Kevin Wolf <kwolf@redhat.com>,\n\tMax Reitz <mreitz@redhat.com>, Fam Zheng <famz@redhat.com>","References":"<20170920102311.25736-1-el13635@mail.ntua.gr>\n\t<20170920102311.25736-2-el13635@mail.ntua.gr>\n\t<20170920142632.GC9409@stefanha-x1.localdomain>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha512;\n\tprotocol=\"application/pgp-signature\"; boundary=\"tavq6tdkbs2vzndn\"","Content-Disposition":"inline","In-Reply-To":"<20170920142632.GC9409@stefanha-x1.localdomain>","User-Agent":"NeoMutt/20170609-57-1e93be (1.8.3)","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2001:648:2000:de::183","Subject":"Re: [Qemu-devel] [PATCH 1/3] block: add bdrv_co_drain_end callback","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,\n\tqemu-devel <qemu-devel@nongnu.org>, qemu-block <qemu-block@nongnu.org>,\n\tMax Reitz <mreitz@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]