提交 ca4523cd 编写于 作者: T Thomas Gleixner 提交者: John Stultz

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: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
上级 48cdc135
...@@ -1341,7 +1341,6 @@ static void update_wall_time(void) ...@@ -1341,7 +1341,6 @@ static void update_wall_time(void)
unsigned long flags; unsigned long flags;
raw_spin_lock_irqsave(&timekeeper_lock, flags); raw_spin_lock_irqsave(&timekeeper_lock, flags);
write_seqcount_begin(&timekeeper_seq);
/* Make sure we're fully resumed: */ /* Make sure we're fully resumed: */
if (unlikely(timekeeping_suspended)) if (unlikely(timekeeping_suspended))
...@@ -1393,6 +1392,7 @@ static void update_wall_time(void) ...@@ -1393,6 +1392,7 @@ static void update_wall_time(void)
*/ */
accumulate_nsecs_to_secs(tk); accumulate_nsecs_to_secs(tk);
write_seqcount_begin(&timekeeper_seq);
/* Update clock->cycle_last with the new value */ /* Update clock->cycle_last with the new value */
clock->cycle_last = tk->cycle_last; clock->cycle_last = tk->cycle_last;
/* /*
...@@ -1407,9 +1407,8 @@ static void update_wall_time(void) ...@@ -1407,9 +1407,8 @@ static void update_wall_time(void)
*/ */
memcpy(real_tk, tk, sizeof(*tk)); memcpy(real_tk, tk, sizeof(*tk));
timekeeping_update(real_tk, false, false); timekeeping_update(real_tk, false, false);
out:
write_seqcount_end(&timekeeper_seq); write_seqcount_end(&timekeeper_seq);
out:
raw_spin_unlock_irqrestore(&timekeeper_lock, flags); raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册