From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [RFC 0/4] KVM in-kernel PM Timer implementation Date: Tue, 14 Dec 2010 13:49:16 -0600 Message-ID: <4D07CA3C.2010108@codemonkey.ws> References: <901746004.680841292328577685.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> <4D078D5A.9060804@codemonkey.ws> <4D07B0DB.7010701@cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Ulrich Obergfell , kvm@vger.kernel.org, glommer@redhat.com, zamsden@redhat.com, avi@redhat.com, mtosatti@redhat.com To: "David S. Ahern" Return-path: Received: from mail-yw0-f46.google.com ([209.85.213.46]:49722 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756853Ab0LNTtU (ORCPT ); Tue, 14 Dec 2010 14:49:20 -0500 Received: by ywl5 with SMTP id 5so596572ywl.19 for ; Tue, 14 Dec 2010 11:49:20 -0800 (PST) In-Reply-To: <4D07B0DB.7010701@cisco.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/14/2010 12:00 PM, David S. Ahern wrote: > > On 12/14/10 08:29, Anthony Liguori wrote: > > >>> I recently used to investigate the performance benefit. In a Linux >>> guest, I was running a program that calls gettimeofday() 'n' times >>> in a loop (the PM Timer register is read during each call). With >>> in-kernel PM Timer, I observed a significant reduction of program >>> execution time. >>> >>> >> I've played with this in the past. Can you post real numbers, >> preferably, with a real work load? >> > 2 years ago I posted relative comparisons of the time sources for older > RHEL guests: > http://www.mail-archive.com/kvm@vger.kernel.org/msg07231.html > Any time you write a program in userspace that effectively equates to a single PIO operation that is easy to emulate, it's going to be remarkably faster to implement that PIO emulation in the kernel than in userspace because vmexit exit cost dominates the execution path. But that doesn't tell you what the impact is in real world workloads. Before we start pushing all device emulation into the kernel, we need to quantify how often gettimeofday() is really called in real workloads. Regards, Anthony Liguori > What's the relative speed of the in-kernel pmtimer compared to the PIT? > > David >