[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] block: Let bdrv_drain_all() to call aio_poll
Re: [Qemu-devel] [PATCH v2] block: Let bdrv_drain_all() to call aio_poll() for each AioContext
Fri, 15 May 2015 10:16:19 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
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 <address@hidden>
>> Cc: Cornelia Huck <address@hidden>
>> Cc: Kevin Wolf <address@hidden>
>> Cc: Paolo Bonzini <address@hidden>
>> Cc: Stefan Hajnoczi <address@hidden>
>> Signed-off-by: Alexander Yarygin <address@hidden>
> Applying on top of 2.3 I can verify the speedup.
> Tested-by: Christian Borntraeger <address@hidden>
Hmmm. When I enable iothreads for all of these devices I get hangs. So
lets defer my Tested-by until I understand that :-(