Re: [Linux-ia64] [PATCH] settimeofday() not synchronised with gettimeofday()

From: Eric Piel <Eric.Piel_at_Bull.Net>
Date: 2003-03-26 23:39:25
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
--- 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;
Received on Wed Mar 26 04:40:52 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:12 EST