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 <borntrae...@de.ibm.com> > Cc: Cornelia Huck <cornelia.h...@de.ibm.com> > Cc: Kevin Wolf <kw...@redhat.com> > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: Stefan Hajnoczi <stefa...@redhat.com> > Signed-off-by: Alexander Yarygin <yary...@linux.vnet.ibm.com> > --- > block/io.c | 42 ++++++++++++++++++++++++++---------------- > 1 file changed, 26 insertions(+), 16 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
pgpPODp4A4R58.pgp
Description: PGP signature