mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "John Being" <olonho@hotmail.com>
To: linux-kernel@vger.kernel.org
Cc: olonho@hotmail.com
Subject: strange nonmonotonic behavior of gettimeoftheday
Date: Fri, 02 Mar 2001 05:30:02 -0000	[thread overview]
Message-ID: <F104TJcu8Puwo7hGP4E00009f3d@hotmail.com> (raw)

I've got following problem with 2.2.17 (Redhat stock kernel)
Linux ***** 2.2.17-14 #1 Mon Feb 5 14:57:25 EST 2001 i586 unknown
on AMD K6,  VIA Technologies VT 82C586, Compaq Presario XL119.
Following C program
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <time.h>
#define ABS(x) (x < 0 ? -x : x)
#define TIME_T struct timeval
#define TIME_DIFF_T long
#define GET_TIME(x) gettimeofday(&x, NULL)
#define TIME_DIFF(x1, x2) ((x2.tv_sec - x1.tv_sec)*1000000 + (x2.tv_usec - 
x1.tv_usec))
int main(int argc, char** argv)
{
   TIME_T t1, t2;
   TIME_DIFF_T d;

   GET_TIME(t2);
   while (1) {
     GET_TIME(t1);
     d = TIME_DIFF(t2, t1);
     if (d > 500000 || d < 0) {
             fprintf(stderr, "Leap found: %ld msec\n", d);
             return 0;
     }
     t2 = t1;
   }
return 1;

gives following result on box in question
root@******:# ./clo
Leap found: -1687 msec
and prints nothing on all other  my boxes.
This gives me bunch of troubles with occasional hang ups and I found nothing 
in kernel archives at 
http://www.uwsg.indiana.edu/hypermail/linux/kernel/index.html
just some notes about smth like this for SMP boxes with ntp. Is this issue 
known, and how can I fix it?

  Thanks.


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


             reply	other threads:[~2001-03-02  5:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-02  5:30 John Being [this message]
2001-03-02 15:07 ` Eli Carter
2001-03-02 15:08 ` strange nonmonotonic behavior of gettimeoftheday -- seen similar problem on PPC Christopher Friesen
2001-03-02 15:40   ` Richard B. Johnson
2001-03-02 18:25     ` george anzinger
2001-03-02 19:14       ` Richard B. Johnson
2001-03-02 20:09         ` george anzinger
2001-03-03  7:42         ` Mike Galbraith
2001-03-03 22:40     ` dean gaudet
2001-03-02 17:06 strange nonmonotonic behavior of gettimeoftheday Manfred Spraul
2001-03-02 22:33 John Being

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=F104TJcu8Puwo7hGP4E00009f3d@hotmail.com \
    --to=olonho@hotmail.com \
    --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

all inboxes | Powered by JetHome®