From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: pvclock (PV and HVM) and vsyscall Date: Mon, 18 Oct 2010 09:34:05 -0700 Message-ID: <4CBC76FD.6030402@goop.org> References: <0d25b778-04e1-432b-8c5c-0f62903f7839@default> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <0d25b778-04e1-432b-8c5c-0f62903f7839@default> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dan Magenheimer Cc: xen-devel@lists.xensource.com, Tim Deegan , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 10/17/2010 06:29 PM, Dan Magenheimer wrote: >> From: Jeremy Fitzhardinge [mailto:jeremy@goop.org] >> Sent: Friday, October 15, 2010 6:28 PM >> To: Dan Magenheimer >> Cc: Tim Deegan; Stefano Stabellini; xen-devel@lists.xensource.com >> Subject: Re: pvclock (PV and HVM) and vsyscall >> >> On 10/15/2010 08:48 AM, Dan Magenheimer wrote: >>> The other discussion of RADclock reminded me: >>> >>> IIRC the pvclock algorithm is still incompatible with >>> vsyscall/vdso (fast system calls) and there was no obvious >>> and upstreamable solution to resolve this. >>> >>> This means that any userland call to the various gettimeofday >>> routines will always do a true system call on both (a) a PV >>> domain or (b) any PV on HVM domain with Stefanos' pvclock patch. >>> >>> Since true syscalls are very expensive on a 64-bit >>> PV domain, I'm wondering if pvclock is still the right >>> default choice for upstream (at least for 64-bit). >> What other options are there? If the tsc is globally stable, then >> using >> pvclock in userspace will work fine; if it isn't, you'll need to do the >> syscall anyway. >> >> There's no basic problem with the vsyscall pvclock patch so long as we >> can know under what circumstances it is safe to enable. > I think (but am not positive) that the circumstances under which > vsyscall pvclock can be enabled are exactly the same as those > for which tsc is globally stable. And when tsc is globally stable, > upstream guest kernels can use tsc instead of pvclock. Not wanting to go around in circles, but usermode can't reliably know whether the tsc is stable enough to be usable directly. Its most reliable course is to always use the proper APIs and rely on the kernel to implement the most efficient mechanism for those APIs. J