From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCdRU-0001d5-1s for qemu-devel@nongnu.org; Wed, 30 Jul 2014 19:38:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCdRH-0006z0-GC for qemu-devel@nongnu.org; Wed, 30 Jul 2014 19:37:56 -0400 Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230]:59425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCdRH-0006yE-8w for qemu-devel@nongnu.org; Wed, 30 Jul 2014 19:37:43 -0400 Received: by mail-we0-f176.google.com with SMTP id q58so1940733wes.7 for ; Wed, 30 Jul 2014 16:37:41 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53D981C0.4030708@redhat.com> Date: Thu, 31 Jul 2014 01:37:36 +0200 From: Paolo Bonzini MIME-Version: 1.0 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 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 coroutine >>> in case of being not necessary and for performance's sake. >> >> No, this is wrong. Dataplane *must* use the same code as non-dataplane, >> 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 necessary on virtio-scsi, and it will not be necessary on virtio-scsi dataplane either. >> 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 devices. >> To begin with, have you benchmarked QEMU and can you provide a trace 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. Paolo