From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4mrs-0001Gv-2X for qemu-devel@nongnu.org; Tue, 16 Jun 2015 05:09:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4mro-0007PA-OR for qemu-devel@nongnu.org; Tue, 16 Jun 2015 05:09:16 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:46985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4mro-0007Ol-DG for qemu-devel@nongnu.org; Tue, 16 Jun 2015 05:09:12 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 16 Jun 2015 10:09:09 +0100 From: Alexander Yarygin References: <1433936297-7098-1-git-send-email-yarygin@linux.vnet.ibm.com> <1433936297-7098-4-git-send-email-yarygin@linux.vnet.ibm.com> <20150616083905.GA22299@stefanha-thinkpad.redhat.com> Date: Tue, 16 Jun 2015 12:08:58 +0300 In-Reply-To: <20150616083905.GA22299@stefanha-thinkpad.redhat.com> (Stefan Hajnoczi's message of "Tue, 16 Jun 2015 09:39:05 +0100") Message-ID: <87a8w06mvp.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 3/3] block: Let bdrv_drain_all() to call aio_poll() for each AioContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , qemu-block@nongnu.org, Ekaterina Tumanova , qemu-devel@nongnu.org, Christian Borntraeger , Cornelia Huck , Paolo Bonzini Stefan Hajnoczi writes: > On Wed, Jun 10, 2015 at 02:38:17PM +0300, Alexander Yarygin wrote: >> After the commit 9b536adc ("block: acquire AioContext in >> bdrv_drain_all()") the aio_poll() function got called for every >> BlockDriverState, in assumption that every device may have its own >> AioContext. If we have thousands of disks attached, there are a lot of >> BlockDriverStates but only a few AioContexts, leading to tons of >> unnecessary aio_poll() calls. >> >> This patch changes the bdrv_drain_all() function allowing it find shared >> AioContexts and to call aio_poll() only for unique ones. >> >> Cc: Christian Borntraeger >> Cc: Cornelia Huck >> Cc: Kevin Wolf >> Cc: Paolo Bonzini >> Cc: Stefan Hajnoczi >> Signed-off-by: Alexander Yarygin >> --- >> block/io.c | 42 ++++++++++++++++++++++++++---------------- >> 1 file changed, 26 insertions(+), 16 deletions(-) > > Thanks, applied this patch only to my block tree: > https://github.com/stefanha/qemu/commits/block > > Patch 2 has a pending issue and Patch 1 is only needed by Patch 2. > > Stefan Ok, I will respin patches 1-2. Thanks!