Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754090AbYCaQDo (ORCPT ); Mon, 31 Mar 2008 12:03:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751586AbYCaQDe (ORCPT ); Mon, 31 Mar 2008 12:03:34 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:57606 "EHLO e1.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751428AbYCaQDd (ORCPT ); Mon, 31 Mar 2008 12:03:33 -0400 Subject: Re: gettimeofday() jumping into the future From: John Stultz To: Thomas Gleixner Cc: Tim Ricketts , Michael Smith , LKML , Andy Wingo , Ingo Molnar In-Reply-To: References: <3c1737210708230408i7a8049a9m5db49e6c4d89ab62@mail.gmail.com> Content-Type: text/plain Date: Mon, 31 Mar 2008 09:03:27 -0700 Message-Id: <1206979407.6175.2.camel@jstultz-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 665 Lines: 23 On Mon, 2008-03-31 at 10:55 +0200, Thomas Gleixner wrote: > > > + if (cycle_now < clock->cycle_last) > > + return 0; > > + > > No, this breaks wrapping clocksources e.g. pmtimer. We need a > different sanity check for that TSC crap. Yea. If you're going to do that sort of logic (which requires a costly cmpxchg as well), it should be done in the read() function of the clocksource. thanks -john -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/