From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4mOp-0006TB-Vc for qemu-devel@nongnu.org; Tue, 16 Jun 2015 04:39:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4mOo-0000bz-Ri for qemu-devel@nongnu.org; Tue, 16 Jun 2015 04:39:15 -0400 Date: Tue, 16 Jun 2015 09:39:05 +0100 From: Stefan Hajnoczi Message-ID: <20150616083905.GA22299@stefanha-thinkpad.redhat.com> References: <1433936297-7098-1-git-send-email-yarygin@linux.vnet.ibm.com> <1433936297-7098-4-git-send-email-yarygin@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: <1433936297-7098-4-git-send-email-yarygin@linux.vnet.ibm.com> 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: Alexander Yarygin Cc: Kevin Wolf , qemu-block@nongnu.org, Ekaterina Tumanova , qemu-devel@nongnu.org, Christian Borntraeger , Cornelia Huck , Paolo Bonzini --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > This patch changes the bdrv_drain_all() function allowing it find shared > AioContexts and to call aio_poll() only for unique ones. >=20 > 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 --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVf+CpAAoJEJykq7OBq3PIXg8IAKW9Ac2dzv+d2tqvNBjiO30v kFG9uRmn8rre68oCDcHCDR5zzLjRvEKGDPRCJ7/dxu+IKI+CP3vEBXDjoQXP3CMl 1Qa6Xqev421p1k89j4d/hLqEkM9wDzUrZCUweG6XPipfHM0sKdU4SUs64SXWWHf4 SfjuW4BCScx2Kk6kSo0QWl/VT7c8SoO00SQsQN5X5z/u1jYbCP9NuDgTS/mk2dtG 5fPHyBCBAWbk+yDw7WQ7sx5wqOT0nmNXI+nqCgYXkQWL0I9xfXK9M8xNpXoEyftO 0wZmZwTua1adAvo9CvHxpLgEYG2ri/UiZhjZsUFlAWBKAvTaY2PG1mgyglgqfQM= =kJyC -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X--