Skip to content

Commit 7ec98e1

Browse files
KAGA-KOKOjohnstultz-work
authored andcommitted
timekeeping: Delay update of clock->cycle_last
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>
1 parent 14a3b6a commit 7ec98e1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎kernel/time/timekeeping.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ static cycle_t logarithmic_accumulation(struct timekeeper *tk, cycle_t offset,
12711271

12721272
/* Accumulate one shifted interval */
12731273
offset -= interval;
1274-
tk->clock->cycle_last += interval;
1274+
tk->cycle_last += interval;
12751275

12761276
tk->xtime_nsec += tk->xtime_interval << shift;
12771277
accumulate_nsecs_to_secs(tk);
@@ -1386,6 +1386,8 @@ static void update_wall_time(void)
13861386
*/
13871387
accumulate_nsecs_to_secs(tk);
13881388

1389+
/* Update clock->cycle_last with the new value */
1390+
clock->cycle_last = tk->cycle_last;
13891391
timekeeping_update(tk, false);
13901392

13911393
out:

0 commit comments

Comments
 (0)