public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Piel <Eric.Piel@Bull.Net>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] [PATCH] settimeofday() not synchronised with
Date: Wed, 26 Mar 2003 12:39:25 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590723705318@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590709806076@msgid-missing>

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

Eric Piel wrote:
> However, now, it still gives negative difference:
> # ./a.out
> requested:      1047572128s 2564ns
> new:            1047572128s 1588ns
> diff is -0.000976000sec
> 
> That's better but there is still something...
> Can anyone reproduce this bug? Any idea about what may cause this
> shifted results?
> 
> I don't understand what does the line in settimeofday():
>         nsec -= (jiffies - wall_jiffies ) * (1000000000 / HZ);

Finally I read the code to do the same thing for i386 (get and
settimeofday()). This explains the meaning of this line, in the i386
it's associated with the equivalent line in do_gettimeofday()! On ia64
everything is done inside of gettimeoffset(). Therefore I'm now
confident that suppressing this line is a Good Thing ;-) The patch doing
it wrt the bk tree is attached.

The test case confirms that it works:
requested:      1048681051s 194873ns
new:            1048681051s 194874ns
diff is  0.000001000sec

That's the same result than on a 2.4.19 . 
This also solved an error on the high resolution timers test suite.

	Eric

[-- Attachment #2: settimeofday2-ia64-2.5.64-030326.patch --]
[-- Type: text/plain, Size: 312 bytes --]

--- arch/ia64/kernel/time.c.back	2003-03-26 11:47:42.000000000 +0100
+++ arch/ia64/kernel/time.c	2003-03-26 11:48:05.000000000 +0100
@@ -98,7 +98,6 @@
 		 * it!
 		 */
 		nsec -= gettimeoffset();
-		nsec -= (jiffies - wall_jiffies ) * (1000000000 / HZ);
 
 		while (unlikely(nsec < 0)) {
 			nsec += 1000000000;

  reply	other threads:[~2003-03-26 12:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-13 16:53 [Linux-ia64] [PATCH] settimeofday() not synchronised with gettimeofday() Eric Piel
2003-03-26 12:39 ` Eric Piel [this message]
2003-03-26 22:19 ` [Linux-ia64] [PATCH] settimeofday() not synchronised with David Mosberger

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-105590723705318@msgid-missing \
    --to=eric.piel@bull.net \
    --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