Re: [RFC] time: xtime_lock is held too long

john stultz
2011-05-06T20:18:17Z

On Fri, 2011-05-06 at 19:42 +0200, Eric Dumazet wrote:
> Le vendredi 06 mai 2011 à 18:59 +0200, Andi Kleen a écrit :
>
> > If you have a better way to make it faster please share it.
>
> Ideally we could use RCU :)
>
> Have whatever state hold in one structure (possibly big, it doesnt
> matter) and switch pointer in writer once everything is setup in new
> structure.

Yea. RCU is tough though, because we do need the hardware cycle value
that we use to be valid for the current interval stored in the
timekeeper structure (ie: the cycle value can't be before the current
cycle_last, and it can't be greater then the next cycle_last).

The reason being, that should a frequency correction occur, you might
end up applying the old frequency to a longer interval then desired,
which could cause small timekeeping inconsistencies.

So we really do need a way to ensure that gettimeofday calls fall on one
side or the other of the accumulation loop. We may be able to tighten
that window some, but I don't know if RCU will work.

thanks
-john