summaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/time.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2014-10-02 10:48:12 -0400
committerChris Metcalf <cmetcalf@tilera.com>2014-10-02 10:48:12 -0400
commit94fb1afbcb3e1f8666c9065baded2cb66e72126f (patch)
treee414f685c7bc7cd88468a0aa834141bec7928e23 /arch/tile/kernel/time.c
parentbceb7efa6a7e656bfaa67b6f54925e7db75bcd52 (diff)
downloadop-kernel-dev-94fb1afbcb3e1f8666c9065baded2cb66e72126f.zip
op-kernel-dev-94fb1afbcb3e1f8666c9065baded2cb66e72126f.tar.gz
tile: switch to using seqlocks for the vDSO time code
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/kernel/time.c')
-rw-r--r--arch/tile/kernel/time.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/tile/kernel/time.c b/arch/tile/kernel/time.c
index d8fbc28..2fe8323 100644
--- a/arch/tile/kernel/time.c
+++ b/arch/tile/kernel/time.c
@@ -249,13 +249,10 @@ cycles_t ns2cycles(unsigned long nsecs)
void update_vsyscall_tz(void)
{
- /* Userspace gettimeofday will spin while this value is odd. */
- ++vdso_data->tz_update_count;
- smp_wmb();
+ write_seqcount_begin(&vdso_data->tz_seq);
vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
vdso_data->tz_dsttime = sys_tz.tz_dsttime;
- smp_wmb();
- ++vdso_data->tz_update_count;
+ write_seqcount_end(&vdso_data->tz_seq);
}
void update_vsyscall(struct timekeeper *tk)
@@ -266,9 +263,8 @@ void update_vsyscall(struct timekeeper *tk)
if (clock != &cycle_counter_cs)
return;
- /* Userspace gettimeofday will spin while this value is odd. */
- ++vdso_data->tb_update_count;
- smp_wmb();
+ write_seqcount_begin(&vdso_data->tb_seq);
+
vdso_data->xtime_tod_stamp = tk->tkr.cycle_last;
vdso_data->xtime_clock_sec = tk->xtime_sec;
vdso_data->xtime_clock_nsec = tk->tkr.xtime_nsec;
@@ -276,6 +272,6 @@ void update_vsyscall(struct timekeeper *tk)
vdso_data->wtom_clock_nsec = wtm->tv_nsec;
vdso_data->mult = tk->tkr.mult;
vdso_data->shift = tk->tkr.shift;
- smp_wmb();
- ++vdso_data->tb_update_count;
+
+ write_seqcount_end(&vdso_data->tb_seq);
}
OpenPOWER on IntegriCloud