From: Keir Fraser Subject: Re: open Linux question Date: Thu, 13 Dec 2007 11:56:19 +0000 Message-ID: References: <47612574.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <47612574.76E4.0078.0@novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: xen-devel@lists.xensource.com, Jeremy Fitzhardinge List-Id: xen-devel@lists.xenproject.org On 13/12/07 11:28, "Jan Beulich" wrote: > I'm not talking about the whole time handling, just the sched_clock() > implementation taking stolen time into account. > > I have to admit that one of the reasons that I didn't try doing this so far > is the odd 'if (offset < 0)' check in there - I would have expected that > rather than doing this the xen_clocksource_read()/get_runstate_snapshot() > pair would need to go in a loop checking that the time version didn't > change (and then a negative offset ought to be a bug). Oh, I see. I think the pv_ops sched_clock() implementation is fine. xen_clocksource_read()/get_runstate_snapshot() do their own version-checkign loops, and I don't think there is really an accuracy issue in not pulling those checks into an outer loop. The 'offset < 0' check is cheap and frankly, where time based on TSC is concerned, it's a nice safety catch. I'd be happy to see that sched_clock() implementation ported into other trees. -- Keir