qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC 0/2] Fix slow startup with many disks
@ 2015-06-03 13:46 Alexander Yarygin
  2015-06-03 13:46 ` [Qemu-devel] [PATCH 1/2] block-backend: Introduce blk_drain() and replace blk_drain_all() Alexander Yarygin
  2015-06-03 13:46 ` [Qemu-devel] [PATCH 2/2] block: Let bdrv_drain_all() to call aio_poll() for each AioContext Alexander Yarygin
  0 siblings, 2 replies; 10+ messages in thread
From: Alexander Yarygin @ 2015-06-03 13:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, qemu-block, Alexander Yarygin, Ekaterina Tumanova,
	Christian Borntraeger, Stefan Hajnoczi, Cornelia Huck,
	Paolo Bonzini

During reset the aio_poll() function is called at least amount_of_disks^2 times:

for_each disk
    virtio_blk_reset()
        bdrv_drain_all()
                for_each disk
                         aio_poll()

For example, startup with 1000 disks takes over 13 minutes.

Patch 1/2 removes inner loop by using bdrv_drain() instead of bdrv_drain_all().
bdrv_drain() works on one disk at time.

Since bdrv_drain_all() is still called in other places, patch 2/2 optimizes
it for cases, where there are more disks than iothreads.

Thanks.

Alexander Yarygin (2):
  block-backend: Introduce blk_drain() and replace blk_drain_all()
  block: Let bdrv_drain_all() to call aio_poll() for each AioContext

 block/block-backend.c          |  5 +++++
 block/io.c                     | 42 ++++++++++++++++++++++++++----------------
 hw/block/virtio-blk.c          |  2 +-
 include/sysemu/block-backend.h |  1 +
 4 files changed, 33 insertions(+), 17 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-06-10 10:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-03 13:46 [Qemu-devel] [PATCH RFC 0/2] Fix slow startup with many disks Alexander Yarygin
2015-06-03 13:46 ` [Qemu-devel] [PATCH 1/2] block-backend: Introduce blk_drain() and replace blk_drain_all() Alexander Yarygin
2015-06-03 13:57   ` Paolo Bonzini
2015-06-03 14:07   ` Christian Borntraeger
2015-06-08  7:36   ` Christian Borntraeger
2015-06-08  9:11   ` Stefan Hajnoczi
2015-06-08 11:03   ` Kevin Wolf
2015-06-10 10:07   ` Fam Zheng
2015-06-03 13:46 ` [Qemu-devel] [PATCH 2/2] block: Let bdrv_drain_all() to call aio_poll() for each AioContext Alexander Yarygin
2015-06-03 14:11   ` Christian Borntraeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).