From patchwork Mon Feb 7 16:03:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 82135 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A539AB70E3 for ; Tue, 8 Feb 2011 07:46:10 +1100 (EST) Received: from localhost ([127.0.0.1]:50258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmU7O-0007Hq-Gz for incoming@patchwork.ozlabs.org; Mon, 07 Feb 2011 11:39:14 -0500 Received: from [140.186.70.92] (port=60769 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmTbr-0001rJ-1d for qemu-devel@nongnu.org; Mon, 07 Feb 2011 11:06:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmTbp-0005ox-QL for qemu-devel@nongnu.org; Mon, 07 Feb 2011 11:06:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmTbp-0005or-H4 for qemu-devel@nongnu.org; Mon, 07 Feb 2011 11:06:37 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p17G6IFR006382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Feb 2011 11:06:18 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p17G6H0O027932; Mon, 7 Feb 2011 11:06:17 -0500 Received: from amt.cnet (vpn-8-34.rdu.redhat.com [10.11.8.34]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p17G6GMj022876; Mon, 7 Feb 2011 11:06:17 -0500 Received: from amt.cnet (localhost.localdomain [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id E1C1468A374; Mon, 7 Feb 2011 14:03:53 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p17G3orr026495; Mon, 7 Feb 2011 14:03:50 -0200 Date: Mon, 7 Feb 2011 14:03:50 -0200 From: Marcelo Tosatti To: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] Re: [PATCH 2/7] Enable I/O thread and VNC threads by default Message-ID: <20110207160350.GA26332@amt.cnet> 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110207101255.GA20413@amt.cnet> User-Agent: Mutt/1.5.20 (2009-08-17) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Anthony Liguori , Stefan Hajnoczi , qemu-devel@nongnu.org, Anthony Liguori , Paul Brook , Arun Bharadwaj , Paulo Bonzini X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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. > > > > > > These issues should be fixable though, so I'm not arguing against > > > enabling it per default. Just mentioning what I've seen FYI.. > > > > Right, remember seeing 20% added overhead for network copy with TCG on > > the initial iothread merge. > > This is not the case anymore, network transfer speed is comparable. > Probably due to SIG_IPI delivery being reliable, which was fixed later. Is there any other issue that prevents turning CONFIG_IOTHREAD on by default? 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); }