From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiqL1-0007YR-RF for qemu-devel@nongnu.org; Wed, 23 Mar 2016 17:29:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiqKw-0002Ye-TF for qemu-devel@nongnu.org; Wed, 23 Mar 2016 17:29:11 -0400 Sender: Paolo Bonzini References: <1458660792-3035-1-git-send-email-kwolf@redhat.com> <1458660792-3035-11-git-send-email-kwolf@redhat.com> From: Paolo Bonzini Message-ID: <56F30A9F.6040300@redhat.com> Date: Wed, 23 Mar 2016 22:29:03 +0100 MIME-Version: 1.0 In-Reply-To: <1458660792-3035-11-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 10/12] block: Drain throttling queue with BdrvChild callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org On 22/03/2016 16:33, Kevin Wolf wrote: > This removes the last part of I/O throttling from block/io.c and moves > it to the BlockBackend. > > When draining the queue of a BlockDriverState, we must make sure that no > new requests can come in for it. Request sources from outside the block > layer are disabled with aio_disable_external(), but the throttling queue > must be handled separately. I have looked at the strategy we talked about today to implement request cancellation (so that e.g. system reset doesn't take ages because of throttled requests). While that may be a worthwhile addition anyway, I think throttling bdrv_drain() may impose an excessive cost for cases such as live migration. The risk of the guest using bdrv_drain() to game throttling is low enough that we can keep on disabling throttling during bdrv_drain(). So for now I think we can merge the two series just fine. The strategy I used in my patch, adding bdrv_no_throttling_begin and bdrv_no_throttling_end around the bdrv_drain loop, can be adapted just as use BdrvChildRole callbacks ->drained_begin and ->drained_end. I will post v3 of my series tomorrow, adopting your patch 1/12 of this series and removing the recursion on bdrv_no_throttling_begin and bdrv_no_throttling_end, which is unnecessary. Paolo