From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtAnD-0002gK-Uf for qemu-devel@nongnu.org; Fri, 15 May 2015 04:16:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtAnA-00011S-OE for qemu-devel@nongnu.org; Fri, 15 May 2015 04:16:27 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:47776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtAnA-00011A-Eg for qemu-devel@nongnu.org; Fri, 15 May 2015 04:16:24 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 May 2015 09:16:23 +0100 Message-ID: <5555AB53.1090709@de.ibm.com> Date: Fri, 15 May 2015 10:16:19 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <1431619400-640-1-git-send-email-yarygin@linux.vnet.ibm.com> <5555995A.2070608@de.ibm.com> In-Reply-To: <5555995A.2070608@de.ibm.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] 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: Alexander Yarygin , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, Ekaterina Tumanova , Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini Am 15.05.2015 um 08:59 schrieb Christian Borntraeger: > Am 14.05.2015 um 18:03 schrieb Alexander Yarygin: >> 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. The bdrv_drain_all() function is called in each >> virtio_reset() call, which in turn is called for every virtio-blk >> device on initialization, so we got aio_poll() called >> 'length(device_list)^2' times. >> >> 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. For example, startup times with 1000 disks >> takes over 13 minutes. >> >> This patch changes the bdrv_drain_all() function allowing it find shared >> AioContexts and to call aio_poll() only for unique ones. This results in >> much better startup times, e.g. 1000 disks do come up within 5 seconds. >> >> Cc: Christian Borntraeger >> Cc: Cornelia Huck >> Cc: Kevin Wolf >> Cc: Paolo Bonzini >> Cc: Stefan Hajnoczi >> Signed-off-by: Alexander Yarygin > > Applying on top of 2.3 I can verify the speedup. > Tested-by: Christian Borntraeger Hmmm. When I enable iothreads for all of these devices I get hangs. So lets defer my Tested-by until I understand that :-(