Skip to content

Commit

Permalink
sched: Fix fallback sched_clock()'s offset when using jiffies
Browse files Browse the repository at this point in the history
Account for the initial offset to the jiffy count.

[ Impact: fix printk timestamps on architectures using fallback sched_clock() ]

Signed-off-by: Ron Lee <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Ron authored and Ingo Molnar committed May 9, 2009
1 parent 091bf76 commit 92d23f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/sched_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
*/
unsigned long long __attribute__((weak)) sched_clock(void)
{
return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
return (unsigned long long)(jiffies - INITIAL_JIFFIES)
* (NSEC_PER_SEC / HZ);
}

static __read_mostly int sched_clock_running;
Expand Down

0 comments on commit 92d23f7

Please sign in to comment.