Received: from eggs.gnu.org ([2001:4830:134:3::10]:50516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCkvy-000811-4l for qemu-devel@nongnu.org; Thu, 31 Jul 2014 03:38:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCkvs-0002fB-0T for qemu-devel@nongnu.org; Thu, 31 Jul 2014 03:37:54 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:56440 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCkvr-0002f0-QD for qemu-devel@nongnu.org; Thu, 31 Jul 2014 03:37:47 -0400 Date: Thu, 31 Jul 2014 09:37:00 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140731073700.GB707@irqsave.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable 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 , Stefan Hajnoczi , Paolo Bonzini The Thursday 31 Jul 2014 =E0 11:55:28 (+0800), Ming Lei wrote : > On Thu, Jul 31, 2014 at 7:37 AM, Paolo Bonzini wr= ote: > > Il 30/07/2014 19:15, Ming Lei ha scritto: > >> On Wed, Jul 30, 2014 at 9:45 PM, Paolo Bonzini = wrote: > >>> Il 30/07/2014 13:39, Ming Lei ha scritto: > >>>> This patch introduces several APIs for supporting bypass qemu coro= utine > >>>> in case of being not necessary and for performance's sake. > >>> > >>> No, this is wrong. Dataplane *must* use the same code as non-datap= lane, > >>> anything else is a step backwards. > >> > >> As we saw, coroutine has brought up performance regression > >> on dataplane, and it isn't necessary to use co in some cases, is it? > > > > Yes, and it's not necessary on non-dataplane either. It's not necess= ary > > on virtio-scsi, and it will not be necessary on virtio-scsi dataplane > > either. >=20 > It is good to know these cases, so they might benefit from this patch > in future too, :-) >=20 > >>> If you want to bypass coroutines, bdrv_aio_readv/writev must detect= the > >>> conditions that allow doing that and call the bdrv_aio_readv/writev > >>> directly. > >> > >> That is easy to detect, please see the 5th patch. > > > > No, that's not enough. Dataplane right now prevents block jobs, but > > that's going to change and it could require coroutines even for raw d= evices. >=20 > Could you explain it a bit why co is required for raw devices in future= ? Block mirroring of a device for example is done using coroutines. As block mirroring can be done on a raw device you need coroutines. >=20 > If some cases for not requiring co can be detected beforehand, these > patches are useful, IMO. >=20 > >>> To begin with, have you benchmarked QEMU and can you provide a trac= e of > >>> *where* the coroutine overhead lies? > >> > >> I guess it may be caused by the stack switch, at least in one of > >> my box, bypassing co can improve throughput by ~7%, and by > >> ~15% in another box. > > > > No guesses please. Actually that's also my guess, but since you are > > submitting the patch you must do better and show profiles where stack > > switching disappears after the patches. >=20 > OK, no problem, I will provide some profile result. >=20 > Thanks, >=20