From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [RFC] Correct/fast timestamping in apps under Xen [1 of 4]: Reliable TSC Date: Fri, 09 Oct 2009 13:28:05 -0700 Message-ID: <4ACF9CD5.1080605@goop.org> References: <20091009093406.GD20579@whitby.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20091009093406.GD20579@whitby.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tim Deegan Cc: "kurt.hackel@oracle.com" , Dan Magenheimer , "Xen-Devel (E-mail)" , Ian Pratt , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 10/09/09 02:34, Tim Deegan wrote: > Your plans for usermode<-->hypervisor direct TSC integration seem to me > to be an unpleasant hack. I understand that you have good business > reasons for wanting it (even if you're not allowed to tell us explicitly > what they are) and we've seen the justifications enough times that we > don't need to cover them again here, but it's still a hack. > > I'm unhappy with the idea of kicking around the Xen timekeeping code > (and introducing the usual bug-tail) to support introducing a usermode > TSC. If there is to be a new mode for this, it should default to the > current (works for everyone except the engineering team of a > not-to-be-named enterprise application) behaviour. > I'm seeing an approx 12x performance improvement with gettimeofday() and clock_gettime() on systems with my vsyscall support patches (~1200ns/call -> ~100ns[*]). I think that should go a long way towards mitigating the performance concerns using standard APIs. There's probably some scope for improving those numbers on systems with better-than-baseline tsc support (ie rdtscp and/or guaranteed synced tscs), but I think its enough to get started with, especially given the broad applicability and relatively simple engineering. [*] With native tsc; emulated tsc makes that 1700 -> 500, or only ~3.3x improvement. J