From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF1sm-0007BR-5F for qemu-devel@nongnu.org; Tue, 03 Apr 2012 07:26:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SF1sf-0006AR-P6 for qemu-devel@nongnu.org; Tue, 03 Apr 2012 07:26:39 -0400 Received: from plane.gmane.org ([80.91.229.3]:34904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF1sf-0006A6-I0 for qemu-devel@nongnu.org; Tue, 03 Apr 2012 07:26:33 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SF1sZ-0000WM-9L for qemu-devel@nongnu.org; Tue, 03 Apr 2012 13:26:27 +0200 Received: from 93-34-182-16.ip50.fastwebnet.it ([93.34.182.16]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 03 Apr 2012 13:26:27 +0200 Received: from pbonzini by 93-34-182-16.ip50.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 03 Apr 2012 13:26:27 +0200 From: Paolo Bonzini Date: Tue, 03 Apr 2012 13:26:16 +0200 Message-ID: References: <1333442297-18932-1-git-send-email-laijs@cn.fujitsu.com> <1333442297-18932-9-git-send-email-laijs@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit In-Reply-To: <1333442297-18932-9-git-send-email-laijs@cn.fujitsu.com> Subject: Re: [Qemu-devel] [PATCH 09/10] coroutine: schedule timeout coroutine instead process it directly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Il 03/04/2012 10:38, Lai Jiangshan ha scritto: > Avoid a timer callback spends too much time. > > Signed-off-by: Lai Jiangshan > --- > qemu-coroutine-sleep.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/qemu-coroutine-sleep.c b/qemu-coroutine-sleep.c > index fd65274..df9254a 100644 > --- a/qemu-coroutine-sleep.c > +++ b/qemu-coroutine-sleep.c > @@ -24,7 +24,7 @@ static void co_sleep_cb(void *opaque) > CoSleepCB *sleep_cb = opaque; > > qemu_free_timer(sleep_cb->ts); > - qemu_coroutine_enter(sleep_cb->co, NULL); > + qemu_co_runnable_schedule(sleep_cb->co); > } > > void coroutine_fn co_sleep_ns(QEMUClock *clock, int64_t ns) Why is this important? Also, why should it be different for timers, fd_handlers (used for example by NBD) and bottom halves (used for AIO callbacks)? Paolo