Re: gettimeofday resolution seriously degraded in test9

From: Stephen Hemminger
Date: Mon Oct 27 2003 - 20:18:31 EST


Arghh... the patch was being way more agressive than necessary.
tickadj which limits NTP is always 1 (for HZ=1000) so NTP will change
at most 1 us per clock tick. This meant we only had to stop time
for the last us of the interval.


diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
--- a/arch/i386/kernel/time.c Mon Oct 27 17:13:22 2003
+++ b/arch/i386/kernel/time.c Mon Oct 27 17:13:22 2003
@@ -110,8 +110,9 @@
* so make sure not to go into next possible interval.
* Better to lose some accuracy than have time go backwards..
*/
- if (unlikely(time_adjust < 0) && usec > tickadj)
- usec = tickadj;
+ if (unlikely(time_adjust < 0) &&
+ unlikely(usec > tick_usec - tickadj))
+ usec = tick_usec - tickadj;

sec = xtime.tv_sec;
usec += (xtime.tv_nsec / 1000);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/