On Tue, 10 Jun 2003, David S. Miller wrote:
TSC do_gettimeofday() is REALLY cheap (TSC read plus a multiply which
x86 does in like 5 cycles).
Aren't the read_lock_irqsave and restore expensive?
read_lock_irqsave(&xtime_lock, flags);
usec = do_gettimeoffset();
{
unsigned long lost = jiffies - wall_jiffies;
if (lost)
usec += lost * (1000000 / HZ);
}
sec = xtime.tv_sec;
usec += xtime.tv_usec;
read_unlock_irqrestore(&xtime_lock, flags);