public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] Re: [PATCH] settimeofday() not synchronised with gettimeofday()
Date: Thu, 13 Mar 2003 20:03:02 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590709806082@msgid-missing> (raw)

>>>>> On Thu, 13 Mar 2003 17:53:43 +0100, Eric Piel <Eric.Piel@Bull.Net> said:

  Eric> gettimeofday() gave a time BEFORE the time we set!  First,
  Eric> I've corrected an obvious problem due to the change of the
  Eric> returned value of gettimeoffset() from usec to nsec in
  Eric> settimeofday().

Ah, yes, thanks for catching that.

  Eric> David, I think you can apply it, at least :-)

The patch looks mostly OK, but it compares an "unsigned long" for < 0,
which can't be right.  I can fix that, though (I'll also fix the
comment for gettimeoffset()).

  Eric> However, now, it still gives negative difference: # ./a.out
  Eric> requested: 1047572128s 2564ns new: 1047572128s 1588ns diff is
  Eric> -0.000976000sec

  Eric> That's better but there is still something...  Can anyone
  Eric> reproduce this bug? Any idea about what may cause this shifted
  Eric> results?

Are you running ntp?

On a related topic: there is another strange 2.5 time related bug.  On
2.4:

	$ time sleep 16.02
	real    0m16.027s
	user    0m0.002s
	sys     0m0.001s

On 2.5:

	$ time sleep 16
	real    0m16.002s
	user    0m0.001s
	sys     0m0.002s


	$ time sleep 16.02
	real    0m25.189s
	user    0m0.000s
	sys     0m0.001s

So clearly something very strange is going on.  My suspicion is that
the bug was introduced back when x86 switched from 100Hz to 1000Hz
ticks, but that's just a guess.  Eric, would you be
able/willing/interested to look into this?

	--david


                 reply	other threads:[~2003-03-13 20:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=marc-linux-ia64-105590709806082@msgid-missing \
    --to=davidm@napali.hpl.hp.com \
    --cc=linux-ia64@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