Skip to content

Commit

Permalink
timekeeping: Delay update of clock->cycle_last
Browse files Browse the repository at this point in the history
For calculating the new timekeeper values store the new cycle_last
value in the timekeeper and update the clock->cycle_last just when we
actually update the new values.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
  • Loading branch information
Thomas Gleixner authored and John Stultz committed Apr 4, 2013
1 parent 14a3b6a commit 7ec98e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/time/timekeeping.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ static cycle_t logarithmic_accumulation(struct timekeeper *tk, cycle_t offset,

/* Accumulate one shifted interval */
offset -= interval;
tk->clock->cycle_last += interval;
tk->cycle_last += interval;

tk->xtime_nsec += tk->xtime_interval << shift;
accumulate_nsecs_to_secs(tk);
Expand Down Expand Up @@ -1386,6 +1386,8 @@ static void update_wall_time(void)
*/
accumulate_nsecs_to_secs(tk);

/* Update clock->cycle_last with the new value */
clock->cycle_last = tk->cycle_last;
timekeeping_update(tk, false);

out:
Expand Down

0 comments on commit 7ec98e1

Please sign in to comment.