From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [RFC] [PATCH] use "reliable" tsc properly when available, but verify Date: Mon, 28 Sep 2009 22:06:36 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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 , "Xen-Devel (E-mail)" List-Id: xen-devel@lists.xenproject.org On 28/09/2009 22:01, "Keir Fraser" wrote: > > Surely it should be sufficient to check TSCs for consistency across all CPUs > periodically, and against the chosen platform timer, and ensure none are > drifting? An operation which would not require us to loop for 2ms and would > provide rather more useful information than an ad-hoc multi-CPU > race-to-update-a-shared-variable-an-arbitrary-and-large-number-of-times. I should add, not only is the algorithm stupid and slow, but it doesn't even check for exactly what RELIABLE_TSC guarantees -- constant-rate TSCs. This would be useless on a single-CPU system, for example, or perhaps more practically a single-socket system where all TSCs skewed together due to package-wide power management. In the latter case TSCs would not skew relative to each other, even though they could 'skew' relative to wallclock (represented in Xen by the platform timer). -- Keir