Skip to content

Commit

Permalink
timekeeping: Shorten seq_count region
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
KAGA-KOKO authored and johnstultz-work committed Apr 4, 2013
1 parent 48cdc13 commit ca4523c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/time/timekeeping.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,6 @@ static void update_wall_time(void)
unsigned long flags;

raw_spin_lock_irqsave(&timekeeper_lock, flags);
write_seqcount_begin(&timekeeper_seq);

/* Make sure we're fully resumed: */
if (unlikely(timekeeping_suspended))
Expand Down Expand Up @@ -1393,6 +1392,7 @@ static void update_wall_time(void)
*/
accumulate_nsecs_to_secs(tk);

write_seqcount_begin(&timekeeper_seq);
/* Update clock->cycle_last with the new value */
clock->cycle_last = tk->cycle_last;
/*
Expand All @@ -1407,9 +1407,8 @@ static void update_wall_time(void)
*/
memcpy(real_tk, tk, sizeof(*tk));
timekeeping_update(real_tk, false, false);

out:
write_seqcount_end(&timekeeper_seq);
out:
raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
}

Expand Down

0 comments on commit ca4523c

Please sign in to comment.