• Steven Rostedt's avatar
    sched_clock: record from last tick · 62c43dd9
    Steven Rostedt authored
    The sched_clock code tries to keep within the gtod time by one tick (jiffy).
    The current code mistakenly keeps track of the delta jiffies between
    updates of the clock, where the the delta is used to compare with the
    number of jiffies that have past since an update of the gtod. The gtod is
    updated at each schedule tick not each sched_clock update. After one
    jiffy passes the clock is updated fine. But the delta is taken from the
    last update so if the next update happens before the next tick the delta
    jiffies used will be incorrect.
    
    This patch changes the code to check the delta of jiffies between ticks
    and not updates to match the comparison of the updates with the gtod.
    Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
    Cc: Steven Rostedt <srostedt@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    62c43dd9
sched_clock.c 5.58 KB