Re: What I suspect : [PATCH] sysdat driver for faster gettimeofday()

Peter Samuelson (peter@wire.cadcamlab.org)
10 Dec 1999 22:54:05 -0600


[Andrea Arcangeli]
> > Your gettimeofday has a resolution of 10msec while the stock
> > gettimeofday has a resolution of 1/CPU_CYCLES_PER_SEC (order of
> > 2pico-sec) on P5 or more recent x86 machines
[John Wright <jwright@cthulhu.engr.sgi.com>]
> How exactly are you figuring the resolution?

#define HZ 100

> I understand that the initial mmap is higher latency but that is
> just on the initial call... Every one after that is just a read from
> memory.

The stock gettimeofday doesn't just return xtime. It uses `rdtsc' (on
Intel) to see how long it's been since the last timer tick (when xtime
was updated). See arch/i386/kernel/time.c, grep for do_gettimeoffset.
Obviously your solution is unable to make this correction. More's the
pity, I liked it otherwise.

Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/