Skip to content

Commit ca4523c

Browse files
KAGA-KOKOjohnstultz-work
authored andcommitted
timekeeping: Shorten seq_count region
Shorten the seqcount write hold region to the actual update of the timekeeper and the related data (e.g vsyscall). On a contemporary x86 system this reduces the maximum latencies on Preempt-RT from 8us to 4us on the non-timekeeping cores. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
1 parent 48cdc13 commit ca4523c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kernel/time/timekeeping.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,6 @@ static void update_wall_time(void)
13411341
unsigned long flags;
13421342

13431343
raw_spin_lock_irqsave(&timekeeper_lock, flags);
1344-
write_seqcount_begin(&timekeeper_seq);
13451344

13461345
/* Make sure we're fully resumed: */
13471346
if (unlikely(timekeeping_suspended))
@@ -1393,6 +1392,7 @@ static void update_wall_time(void)
13931392
*/
13941393
accumulate_nsecs_to_secs(tk);
13951394

1395+
write_seqcount_begin(&timekeeper_seq);
13961396
/* Update clock->cycle_last with the new value */
13971397
clock->cycle_last = tk->cycle_last;
13981398
/*
@@ -1407,9 +1407,8 @@ static void update_wall_time(void)
14071407
*/
14081408
memcpy(real_tk, tk, sizeof(*tk));
14091409
timekeeping_update(real_tk, false, false);
1410-
1411-
out:
14121410
write_seqcount_end(&timekeeper_seq);
1411+
out:
14131412
raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
14141413
}
14151414

0 commit comments

Comments
 (0)