>Well, first of all, every single network packet which arrives at or
>leaves your system uses the guts of gettimeofday() to timestamp
>the packet.
In the tcp stack you are just inside the kernel so you don't pay the
enter/exit cost to get the TOD information.
The optimization discussed wanted to avoid the cost to enter the kernel.
I think it's not possible to implement an userspace rdtsc based TOD
without entering the kernel and without losing precision. We can't acquire
a spinlock from userspace because we can be preempted. Without the
spinlock we can't serialize the reads of xtime and of the reference-RTSCT
information.
The only not racy way is to have in the readable magic kernel page a
static xtime and rdtsc information plus the coversion constant from cycles
to seconds. But if the conversion is not perfect we'll lose precision over
the time...
Andrea
-
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/