From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDCeV-0007ZP-40 for qemu-devel@nongnu.org; Fri, 01 Aug 2014 09:13:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDCeP-0007gG-Ul for qemu-devel@nongnu.org; Fri, 01 Aug 2014 09:13:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDCeP-0007fl-Ky for qemu-devel@nongnu.org; Fri, 01 Aug 2014 09:13:37 -0400 Date: Fri, 1 Aug 2014 14:13:30 +0100 From: Stefan Hajnoczi Message-ID: <20140801131330.GE7258@stefanha-thinkpad.redhat.com> References: <1406720388-18671-1-git-send-email-ming.lei@canonical.com> <1406720388-18671-2-git-send-email-ming.lei@canonical.com> <53D8F6F0.7040106@redhat.com> <53D981C0.4030708@redhat.com> <53DA0940.2030207@redhat.com> <53DA6F20.3050200@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SWTRyWv/ijrBap1m" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 01/15] qemu coroutine: support bypass mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei Cc: Kevin Wolf , Peter Maydell , Fam Zheng , "Michael S. Tsirkin" , qemu-devel , Paolo Bonzini --SWTRyWv/ijrBap1m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 01, 2014 at 10:54:02AM +0800, Ming Lei wrote: > On Fri, Aug 1, 2014 at 12:30 AM, Paolo Bonzini wrot= e: > > Il 31/07/2014 18:13, Ming Lei ha scritto: > >> Follows 'perf report' result on cycles event for with/without bypass > >> coroutine: > >> > >> http://pastebin.com/ae0vnQ6V > >> > >> From the profiling result, looks bdrv_co_do_preadv() is a bit slow > >> without bypass coroutine. > > > > Yeah, I can count at least 3.3% time spent here: > > > > 0.87% bdrv_co_do_preadv > > 0.79% bdrv_aligned_preadv > > 0.71% qemu_coroutine_switch > > 0.52% tracked_request_begin > > 0.45% coroutine_swap > > > > Another ~3% wasted in malloc, etc. >=20 > That should be related with coroutine and the BH in bdrv_co_do_rw(). > In this post I didn't apply Stephan's coroutine resize patch which might > decrease usage of malloc() for coroutine. Please rerun with "[PATCH v3 0/2] coroutine: dynamically scale pool size". > At least, coroutine isn't cheap from the profile result. Instead of bypassing coroutines we should first understand the overhead that they impose. Is it due to the coroutine implementation (switching stacks) or due to the bdrv_co_*() code that happens to use coroutines but slow for other reasons. --SWTRyWv/ijrBap1m Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT25J6AAoJEJykq7OBq3PI+D0IAMnjFPClh3uZcF4EqSFUg3L/ 1Zszn3HRkiUNnMzCSglJnUGKVHxU3XjYp0DufstIc9qYJYnXhKsf7zhvb7AfJMaa GM63OnUWoEFQvBIWtUu0BWmpQ3839odPy81vcMWEy3FXdM9l+aByKq2yS17NzBJm lSOVlESvJ4L4yzlPkisbTot1gQB0bjcZlLIvUYpRAFLmrXZZIA/RO5c2QA0FJJac 9iQ4W28fsEtMxhgQa1Dyw4mQNfzTiPN3vRuMIirCvzApTGCFaR4+7WYeIZcx2pCA 6SgFbVcmyLAqHyq8NvzhlqBU+Z2iGD0d1LkVQ7wckx0urKB8jH8lPub9xSvprkE= =QmHB -----END PGP SIGNATURE----- --SWTRyWv/ijrBap1m--