From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1INSYA-00050D-9i for qemu-devel@nongnu.org; Tue, 21 Aug 2007 08:09:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1INSY8-0004zh-Np for qemu-devel@nongnu.org; Tue, 21 Aug 2007 08:09:33 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INSY8-0004zb-I7 for qemu-devel@nongnu.org; Tue, 21 Aug 2007 08:09:32 -0400 Received: from il.qumranet.com ([82.166.9.18]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1INSY8-0005P3-F2 for qemu-devel@nongnu.org; Tue, 21 Aug 2007 08:09:32 -0400 Message-ID: <46CAD607.2080504@qumranet.com> Date: Tue, 21 Aug 2007 15:09:43 +0300 From: Avi Kivity MIME-Version: 1.0 References: <20070817231149.544849769@gmail.com> <1187450256.13580.1.camel@squirrel> <64F9B87B6B770947A9F8391472E032160D4645F0@ehost011-8.exch011.intermedia.net> <20070818220252.GA19526@dreamland.darkstar.lan> <68676e00708190952g7d4751c2g87a6ff71dd278f71@mail.gmail.com> <46C89A8E.7040609@qumranet.com> <20070820212058.GA6713@dreamland.darkstar.lan> In-Reply-To: <20070820212058.GA6713@dreamland.darkstar.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [kvm-devel] [PATCH 0/4] Rework alarm timer infrastrucure - take2 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luca Tettamanti Cc: kvm-devel@lists.sf.net, qemu-devel@nongnu.org Luca Tettamanti wrote: >>> >>> >> Run a 100Hz guest, measure cpu usage using something accurate like >> cyclesoak, with and without dynticks, with and without kvm. >> > > Ok, here I've measured the CPU usage on the host when running an idle > guest. > > At 100Hz > > QEMU > hpet 4.8% > dynticks 5.1% > > Note: I've taken the mean over a period of 20 secs, but the difference > between hpet and dynticks is well inside the variability of the test. > > KVM > hpet 2.2% > dynticks 1.0% > > Hum... here the numbers jumps a bit, but dynticks is always below hpet. > The differences here are small, so I'll focus on the 1000Hz case. > At 1000Hz: > > QEMU > hpet 5.5% > dynticks 11.7% > > KVM > hpet 3.4% > dynticks 7.3% > > No surprises here, you can see the additional 1k syscalls per second. This is very surprising to me. The 6.2% difference for the qemu case translates to 62ms per second, or 62us per tick at 1000Hz. That's more than a hundred simple syscalls on modern processors. We shouldn't have to issue a hundred syscalls per guest clock tick. The difference with kvm is smaller (just 3.9%), which is not easily explained as the time for the extra syscalls should be about the same. My guess is that guest behavior is different; with dynticks the guest does about twice as much work as with hpet. Can you verify this by running strace -c -p `pgrep qemu` & sleep 10; pkill strace for all 4 cases, and posting the results? -- error compiling committee.c: too many arguments to function