linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@arcor.de>
To: Trammell Hudson <hudson@osresearch.net>, linux-kernel@vger.kernel.org
Subject: Re: gettimeofday running backwards on 2.4.20
Date: Thu, 24 Apr 2003 21:35:31 +0200	[thread overview]
Message-ID: <20030424193410.C52BF12F067@mx12.arcor-online.net> (raw)
In-Reply-To: <20030422232316.GF20108@osbox.osresearch.net>

On Wed 23 Apr 03 01:23, Trammell Hudson wrote:
> [ Please cc hudson@osresearch.net on any replies.  Thank you! ]
>
> A few months ago I noticed gettimeofday running backwards on
> dual Pentium II and dual Pentium Pro systems with 2.4.18.  Based
> on postings made to linux-kernel in June of 2002, I upgraded
> to 2.4.20 and the problem seemed to go away:
>
>   http://groups.google.com/groups?threadm=3D16DE83.3060409@tiscalinet.it
>
> Just recently my NAS benchmarks and MPI latency tests showed bizarre
> results, so I pulled out my test program and am seeing the same
> problems again.  It seems that roughly 50 in 1 million calls go
> backwards, even with 2.4.20.

It's happening on my VAIO laptop as well, with a similar frequency.  The size 
of the typical regression dropped by roughly an order of magnitude between 
2.4.19 and 2.4.20, from several 10's of ms to a few ms.

There needs to be a final idiot check in there, as the last thing that 
happens in sys_gettimeofday, to catch and prevent such regressions in a 
brutally stupid way, in addition to the fancy algorithm that tries to prevent 
them, and has never fully succeeded in doing that.

A reasonable algorithm is: if time goes backwards by less than a second, it 
wasn't somebody changing the clock, so return the previous timeofday, 
otherwise, save the new value for the next test.

Applications like games (but not only games) can get pretty messed up by a 
timeofday that jumps backwards every couple of seconds.

Regards,

Daniel

  reply	other threads:[~2003-04-24 19:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-22 23:23 gettimeofday running backwards on 2.4.20 Trammell Hudson
2003-04-24 19:35 ` Daniel Phillips [this message]
2003-04-24 21:41   ` Jamie Lokier
2003-04-24 22:04     ` Daniel Phillips
     [not found] <200305062020.h46KKww1193872@northrelay02.pok.ibm.com>
2003-05-06 20:33 ` john stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030424193410.C52BF12F067@mx12.arcor-online.net \
    --to=phillips@arcor.de \
    --cc=hudson@osresearch.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).