Re: gettimeofday() a special case : why?

Artur Skawina (skawina@geocities.com)
Mon, 13 Dec 1999 13:20:21 +0100


salkin@mindspring.com wrote:
>
> I don't want to be too OT or bothersome, but can someone explain why
> gettimeofday() is the one syscall that optimization at the ~100 cycle level
> makes sense for? If it's a long explanation, a link or pointer to a book is

It's relatively common, used eg for timestamping events, often _every_ event
(strace a few X apps etc to see some examples).
It's also special because it does not need to switch domains -- on modern
cpus the required information is (or can be made) available to the caller,
hence it's possible to avoid entering the kernel at all. (in general, this
depends on cpu capabilities, security levels etc)

Note it's not about saving 100 cycles, it is about speeding up
gettimeofday() on a 686 by a factor of three.

-
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/