WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [PATCH] Re: [Xen-devel] Time went backwards

To: Rik van Riel <riel@xxxxxxxxxx>
Subject: Re: [PATCH] Re: [Xen-devel] Time went backwards
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Tue, 14 Mar 2006 16:44:02 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 14 Mar 2006 16:44:37 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <Pine.LNX.4.63.0603141042500.1225@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <Pine.LNX.4.63.0603101157290.23847@xxxxxxxxxxxxxxxxxxxxxx> <5cee5f1c21deb3039d4a63748ae45b54@xxxxxxxxxxxx> <ad0d34be2ad1520ecc15c7a33bb56024@xxxxxxxxxxxx> <Pine.LNX.4.63.0603101232350.23847@xxxxxxxxxxxxxxxxxxxxxx> <962617b5496bcddd4ca3560862da9e5a@xxxxxxxxxxxx> <Pine.LNX.4.63.0603101656430.31290@xxxxxxxxxxxxxxxxxxxxxx> <50482ad77399d3f8968130be562d1e96@xxxxxxxxxxxx> <Pine.LNX.4.63.0603131650520.25148@xxxxxxxxxxxxxxxxxxxxxx> <Pine.LNX.4.63.0603131730340.25148@xxxxxxxxxxxxxxxxxxxxxx> <Pine.LNX.4.63.0603131803500.25148@xxxxxxxxxxxxxxxxxxxxxx> <2595229dc26f30439cfcf796060bd28e@xxxxxxxxxxxx> <Pine.LNX.4.63.0603141007330.1225@xxxxxxxxxxxxxxxxxxxxxx> <60a215cbba64464c7b53bebb79b463e3@xxxxxxxxxxxx> <Pine.LNX.4.63.0603141023520.1225@xxxxxxxxxxxxxxxxxxxxxx> <Pine.LNX.4.63.0603141032090.1225@xxxxxxxxxxxxxxxxxxxxxx> <2cd0957cc0e97a442ae00b5adea82a41@xxxxxxxxxxxx> <Pine.LNX.4.63.0603141042500.1225@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

On 14 Mar 2006, at 15:43, Rik van Riel wrote:

Actually, we come into timer_interrupt() sometimes with
blocked + stolen > delta_cpu, so the bugfix is valid.

I just no longer understand how we can get into this
situation...

Could be due to horrendous clock jitter across CPUs.

Not on a single CPU system ;)

Hmmm... well, a few suggestions:
1. The first do-while loop in timer_interrupt() in time-xen.c aims to get a consistent snapshot of blocked, stolen and delta_cpu, by checking timestamp-info version numbers in the two while predicates. I just added a rmb() to time_values_up_to_date() -- required for absolute accuracy and will also act as a compiler barrier too. But the likelihood of gcc having moved that test earlier is very small I think. :-) If it had, though, you could end up with a later snapshot of stolen/blocked than of delta_cpu, which would be bad. 2. Maybe the time synchronising code in Xen is broken. I tested it pretty hard when I implemented it, but you never know. It would be bad if time could step backwards during local_time_calibration() in xen/arch/x86/time.c. It might be worth doing a before-and-after check in that function (e.g., see whether value returned by get_s_time() gets smaller).

This bug can't be *that* hard to find on a single CPU system. :-)

 -- Keir


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel