[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

non-monotonic do_gettimeofday?



hi, 
in kernel 2.4.14, I have noticed that sometimes when the CPU load is
extremely high, the clock jumps backwards. Here is how it happens: I send UDP 
packets and receive them back from an echoer, much like
ping. The packets have a user space send timestamp using gettimeofday,
and _kernel_ space receive timestamps retrieved using the SIOCGSTAMP
ioctl. 


To get high precision receive timestamps, I have replaced the 
get_fast_time call in netif_rx with the do_gettimeofday call. 
Sometimes, under high load conditions, the kernel receive timestamps are
smaller than the user receive timestamps. 

Is this the same bug that used to be in 2.4.5? (there was a report of
this on the mailing list a while back). 

a related question: do_gettimeofday disables interrupts, right?. does this
mean
that we could lose timer interrupts (or any other interrupts) simply by
calling gettimeofday in a tight loop (and this is a possible reason for
the non-monotonic timestamps?), or is the timer interrupt non-maskable? 

TIA, 
akshay