From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: Can Linux kernel handle unsynced TSC? Date: Fri, 29 Feb 2008 15:27:21 +0100 Message-ID: <1204295241.6243.108.camel@lappy> References: <1204281823.6243.78.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org To: Zhao Forrest Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org On Fri, 2008-02-29 at 22:20 +0800, Zhao Forrest wrote: > On 2/29/08, Peter Zijlstra wrote: > > > > On Fri, 2008-02-29 at 16:55 +0800, Zhao Forrest wrote: > > > Sorry for reposting it. > > > > > > For example, > > > 1 rdtsc() is invoked on CPU0 > > > 2 process is migrated to CPU1, and rdtsc() is invoked on CPU1 > > > 3 if TSC on CPU1 is slower than TSC on CPU0, can kernel guarantee > > > that the second rdtsc() doesn't return a value smaller than the one > > > returned by the first rdtsc()? > > > > No, rdtsc() goes directly to the hardware. You need a (preferably cheap) > > clock abstraction layer on top if you need this. > > Thank you for the clarification. I think gettimeofday() is such kind > of clock abstraction layer, am I right? Yes, gtod is one such a layer, however it fails the 'cheap' test for many definitions of cheap. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/