From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Theurer Subject: Re: gettimeofday() vsyscall for kvm-clock? Date: Mon, 21 May 2012 17:13:29 -0500 Message-ID: <4FBABE09.2010604@linux.vnet.ibm.com> References: <4FBAA50E.4010006@linux.vnet.ibm.com> <20120521203642.GA26834@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from e6.ny.us.ibm.com ([32.97.182.146]:41807 "EHLO e6.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755465Ab2EUWPA (ORCPT ); Mon, 21 May 2012 18:15:00 -0400 Received: from /spool/local by e6.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 21 May 2012 18:14:59 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 3509B38C8059 for ; Mon, 21 May 2012 18:14:27 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4LMERul124092 for ; Mon, 21 May 2012 18:14:27 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4LMEQpl030602 for ; Mon, 21 May 2012 19:14:27 -0300 In-Reply-To: <20120521203642.GA26834@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 05/21/2012 03:36 PM, Marcelo Tosatti wrote: > On Mon, May 21, 2012 at 03:26:54PM -0500, Andrew Theurer wrote: >> Wondering if a user-space gettimofday() for kvm-clock has been >> considered before. I am seeing a pretty large difference in >> performance between tsc and kvm-clock. I have to assume at least >> some of this is due to the mode switch for kvm-clock. Here are the >> results: >> >> (this is a 16 vCPU VM on a 16 thread 2S Nehalem-EP host, looped >> gettimeofday() calls on all vCPUs) >> >> tsc: .0645 usec per call >> kvm-clock: .4222 usec per call (6.54x) >> >> >> -Andrew Theurer > > https://bugzilla.redhat.com/show_bug.cgi?id=679207 > > "model name : Intel(R) Xeon(R) CPU E5540 @ 2.53GHz > > native, gettimeofday (vsyscall): 45ns > guest, kvmclock (syscall): 198ns" > > But this was before > > commit 489fb490dbf8dab0249ad82b56688ae3842a79e8 > Author: Glauber Costa > Date: Tue May 11 12:17:40 2010 -0400 > > x86, paravirt: Add a global synchronization point for pvclock > > (see the full changelog for details). > > Can you try disabling the global variable, to see if that makes > a difference (should not be enabled in production)? Untested patch > (against guest kernel) below The following was re-done on a 3.4 guest kernel (previously RHEL kernel): 1-way: tsc: .0315 kvm-clock: .2112 (6.7x) 16-way: tsc: .0432 kvm-clock: .4825 (11.1x) Now with global var disabled: 16-way: kvm-clock: .4628 Does not look like much of a difference. -Andrew