From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38711 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmYLU-0007yZ-BY for qemu-devel@nongnu.org; Mon, 07 Feb 2011 16:10:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmVvx-0002lH-0z for qemu-devel@nongnu.org; Mon, 07 Feb 2011 13:35:34 -0500 Received: from mail-ey0-f173.google.com ([209.85.215.173]:53917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmVvw-0002kt-Rl for qemu-devel@nongnu.org; Mon, 07 Feb 2011 13:35:32 -0500 Received: by eyg7 with SMTP id 7so2555617eyg.4 for ; Mon, 07 Feb 2011 10:35:31 -0800 (PST) Date: Mon, 7 Feb 2011 19:35:26 +0100 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] Re: [PATCH 2/7] Enable I/O thread and VNC threads by default Message-ID: <20110207183526.GA9697@laped.lan> References: <1295902845-29807-1-git-send-email-aliguori@us.ibm.com> <1295902845-29807-3-git-send-email-aliguori@us.ibm.com> <4D3DFD20.8060004@linux.vnet.ibm.com> <20110125091741.GB30239@edde.se.axis.com> <20110125133453.GC5427@amt.cnet> <20110207101255.GA20413@amt.cnet> <20110207160350.GA26332@amt.cnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110207160350.GA26332@amt.cnet> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti Cc: Anthony Liguori , Stefan Hajnoczi , qemu-devel@nongnu.org, Anthony Liguori , Paul Brook , Arun Bharadwaj , Paulo Bonzini On Mon, Feb 07, 2011 at 02:03:50PM -0200, Marcelo Tosatti wrote: > On Mon, Feb 07, 2011 at 08:12:55AM -0200, Marcelo Tosatti wrote: > > > > One more thing I didn't mention on the email-thread or on IRC is > > > > that last time I checked, qemu with io-thread was performing > > > > significantly slower than non io-thread builds. That was with > > > > TCG emulation (not kvm). Somewhere between 5 - 10% slower, IIRC. > > > > Can you recall what was the test ? > > > > > > Also, although -icount & iothread no longer deadlocks, icount > > > > still sometimes performs incredibly slow with the io-thread (compared > > > > to non-io-thread qemu). In particular when not using -icount auto but > > > > a fixed ticks per insn values. Sometimes it's so slow I thought it > > > > actually deadlocked, but no it was crawling :) I haven't had time > > > > to look at it any closer but I hope to do soon. > > Edgar, please give the attached patch a try with fixed icount value. The > calculation for next event makes no sense for iothread timeout, only for > vcpu context. Thanks Marcelo, this patch fixes the problems I was seeing here. Cheers > diff --git a/cpus.c b/cpus.c > index 9c50a34..2280db1 100644 > --- a/cpus.c > +++ b/cpus.c > @@ -748,7 +748,7 @@ static void qemu_tcg_wait_io_event(void) > CPUState *env; > > while (!any_cpu_has_work()) > - qemu_cond_timedwait(tcg_halt_cond, &qemu_global_mutex, 1000); > + qemu_cond_timedwait(tcg_halt_cond, &qemu_global_mutex, qemu_calculate_timeout()); > > qemu_mutex_unlock(&qemu_global_mutex); > > diff --git a/vl.c b/vl.c > index 837be97..dbd81a1 100644 > --- a/vl.c > +++ b/vl.c > @@ -1323,7 +1323,7 @@ void main_loop_wait(int nonblocking) > if (nonblocking) > timeout = 0; > else { > - timeout = qemu_calculate_timeout(); > + timeout = 1000; > qemu_bh_update_timeout(&timeout); > } >