• John Stultz's avatar
    clocksource: keep track of original clocksource frequency · 1aa5dfb7
    John Stultz authored
    The clocksource frequency is represented by
    clocksource->mult/2^(clocksource->shift).  Currently, when NTP makes
    adjustments to the clock frequency, they are made directly to the mult
    value.
    
    This has the drawback that once changed, we cannot know what the orignal
    mult value was, or how much adjustment has been applied.
    
    This property causes problems in calculating proper ntp intervals when
    switching back and forth between clocksources.
    
    This patch separates the current mult value into a mult and mult_orig
    pair.  The mult_orig value stays constant, while the ntp clocksource
    adjustments are done only to the mult value.
    
    This allows for correct ntp interval calculation and additionally lays the
    groundwork for a new notion of time, what I'm calling the monotonic-raw
    time, which is introduced in a following patch.
    Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
    Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    1aa5dfb7
clocksource.c 14 KB