This patch fixes a race in the timer_interrupt code caused bydetect_lost_tick(). Since we're doing lost-tick compensation outsidetimer->mark_offset, time can pass between time-source reads which cancause gettimeofday inconsistencies.

Additionally detect_lost_tick() was broken for the PIT case, since thewhole point of detect_lost_tick() is to interpolate between two timesources to find inconsistencies. Additionally this could causextime_lock seq_lock reader starvation which has been causing machinehangs for SMP boxes that use the PIT as a time source.

This patch fixes the described race by removing detect_lost_tick() andinstead implementing the lost tick detection code inside mark_offset().

Some of the divs and mods being added here might concern folks, but bynot calling timer->get_offset() in detect_lost_tick() we eliminate muchof the same math. I did some simple cycle counting and the new codecomes out on average equivalent or faster.