From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF1wa-0008Pb-7x for qemu-devel@nongnu.org; Tue, 03 Apr 2012 07:30:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SF1wT-0007O3-RR for qemu-devel@nongnu.org; Tue, 03 Apr 2012 07:30:35 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:37802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF1wT-0007Ng-JW for qemu-devel@nongnu.org; Tue, 03 Apr 2012 07:30:29 -0400 Received: by dadz9 with SMTP id z9so4204843dad.33 for ; Tue, 03 Apr 2012 04:30:27 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4F7ADF4D.7030906@redhat.com> Date: Tue, 03 Apr 2012 13:30:21 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1333442297-18932-1-git-send-email-laijs@cn.fujitsu.com> In-Reply-To: <1333442297-18932-1-git-send-email-laijs@cn.fujitsu.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/10] coroutine: use qemu_coroutine_switch() directly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lai Jiangshan Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , qemu-devel@nongnu.org Il 03/04/2012 10:38, Lai Jiangshan ha scritto: > When qemu_coroutine_switch() in the qemu_coroutine_yield() returns, > It must be someone calls qemu_coroutine_enter() for it, so the @to > is active, the tests in coroutine_swap() are unneeded, so we use > qemu_coroutine_switch() directly in qemu_coroutine_yield(). The patches are very different. Some of them are just cleanups which I like (patches 2 to 7, more or less). The others seem to be a (micro?) optimization whose usecase and result you didn't document because there was no cover letter. This patch is an example, is one or two "if"s so expensive that it matters? Paolo > Signed-off-by: Lai Jiangshan > --- > qemu-coroutine.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/qemu-coroutine.c b/qemu-coroutine.c > index 600be26..c01252e 100644 > --- a/qemu-coroutine.c > +++ b/qemu-coroutine.c > @@ -71,5 +71,5 @@ void coroutine_fn qemu_coroutine_yield(void) > } > > self->caller = NULL; > - coroutine_swap(self, to); > + qemu_coroutine_switch(self, to, COROUTINE_YIELD); > }