diff options
| author | Ron <ron@voicetronix.com> | 2009-05-08 09:24:49 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-05-09 04:08:19 -0400 |
| commit | 92d23f703c608fcb2c8edd74a3fd0f4031e18606 (patch) | |
| tree | ecd2e7f94fea20188eb75cabbcd48a7f7ab79dbc | |
| parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) | |
sched: Fix fallback sched_clock()'s offset when using jiffies
Account for the initial offset to the jiffy count.
[ Impact: fix printk timestamps on architectures using fallback sched_clock() ]
Signed-off-by: Ron Lee <ron@debian.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| -rw-r--r-- | kernel/sched_clock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c index 819f17ac796e..e1d16c9a7680 100644 --- a/kernel/sched_clock.c +++ b/kernel/sched_clock.c | |||
| @@ -38,7 +38,8 @@ | |||
| 38 | */ | 38 | */ |
| 39 | unsigned long long __attribute__((weak)) sched_clock(void) | 39 | unsigned long long __attribute__((weak)) sched_clock(void) |
| 40 | { | 40 | { |
| 41 | return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ); | 41 | return (unsigned long long)(jiffies - INITIAL_JIFFIES) |
| 42 | * (NSEC_PER_SEC / HZ); | ||
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | static __read_mostly int sched_clock_running; | 45 | static __read_mostly int sched_clock_running; |
