From: Dan Magenheimer Subject: RE: rdtscP and xen (and maybe the app-tsc answer I've been looking for) Date: Tue, 22 Sep 2009 12:36:18 -0700 (PDT) Message-ID: <60339ddd-4a9d-4efe-bd0a-bcc09bc6d468@default> References: <4AB81289.8040604@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4AB81289.8040604@goop.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: kurt.hackel@oracle.com, "Xen-Devel (E-mail)" , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org > From: Jeremy Fitzhardinge [mailto:jeremy@goop.org] > This rdtscp proposal is basically the latter, as a variant of the > pvclock algorithm. I'm mostly interested in it as an=20 > implementation for > vsyscall etc, rather than something that apps would use directly. > From: Jan Beulich [mailto:JBeulich@novell.com] > I continue to think that it would be fundamentally wrong to use pCPU > numbers here: Not only do you share information with the app that it > shouldn't really care about, but you also push scalability=20 > issues to it > that the kernel is supposed to abstract out for apps. While I have been hopeful that we can identify a solution that can solve both problems (vsyscall+pvclock and pvrdtscp), I have been concerned we might run into a fundamental conflict since both of us may be attempting to use TSC_AUX for somewhat different purposes. Then in taking a step back to think about this, I realized we may be farther apart in our objectives than I first thought. So I thought it would be a good idea to revisit some assumptions. I am assuming that rdtsc and rdtscp are always emulated; but for some "high frequency timestamp apps" (HFTSAs), trying to define a mechanism where rdtsc/rdtscp are always correct AND, in certain constrained environments, also fast (non-emulated). Any userland pvclock algorithm still requires a rdtsc (or rdtscp) instruction which -- EXCEPT in those certain constrained environments -- is emulated. But the whole point of pvclock is to be faster than entering the hypervisor, right? Are you (Jeremy) still assuming that rdtsc/rdtscp are NOT emulated? Or are you trying to define a vsyscall+pvclock mechanism for the same constrained environments so that HFTSAs have a choice of using clock_gettime instead of pvrdtsc, either of which will be fast? Or am I missing another option altogether? Dan