• David Mosberger's avatar
    [PATCH] time-offset patch · 9d64273c
    David Mosberger authored
    On ia64 MP machines, we use the cycle counter register of each CPU to
    obtain fine-grained time-stamps.  At boot-time, we synchronize the
    counters as close as possible (similar to x86, though with a different
    algorithm).  But even with this synchronization, there is still a
    small (really: tiny) chance that a process bouncing from one CPU to
    another could observe time going backwards.  To guard against this, I
    maintain a global variable called "last_time_offset" which keeps track
    of the largest time-interpolation value returned so far.  Most of this
    is in platform-specific code (arch/ia64/kernel/time.c), but there are
    a handful of places in platform-independent code where this variable
    needs to be cleared to zero.  This is what the patch below does.  I
    didn't put it inside CONFIG_IA64 because I think this can be useful
    for other platforms, too.  I suppose I could put it inside CONFIG_SMP
    though this would make the code uglier.  If you think it's OK, please
    apply, otherwise, I'd appreciate your feedback.
    9d64273c
time.c 11.8 KB