]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ia64: vsyscall: Use seqcount instead of seqlock
authorThomas Gleixner <tglx@linutronix.de>
Tue, 28 Feb 2012 19:46:05 +0000 (19:46 +0000)
committerJohn Stultz <john.stultz@linaro.org>
Fri, 16 Mar 2012 01:17:59 +0000 (18:17 -0700)
The update of the vdso data happens under xtime_lock, so adding a
nested lock is pointless. Just use a seqcount to sync the readers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
arch/ia64/kernel/asm-offsets.c
arch/ia64/kernel/fsys.S
arch/ia64/kernel/fsyscall_gtod_data.h
arch/ia64/kernel/time.c

index af56501690432110a1f27847bea9dffd60737b81..106aeb670e5409398e3a742bd72cf08e1c9fa8c7 100644 (file)
@@ -269,8 +269,8 @@ void foo(void)
        BLANK();
 
        /* used by fsys_gettimeofday in arch/ia64/kernel/fsys.S */
-       DEFINE(IA64_GTOD_LOCK_OFFSET,
-               offsetof (struct fsyscall_gtod_data_t, lock));
+       DEFINE(IA64_GTOD_SEQ_OFFSET,
+               offsetof (struct fsyscall_gtod_data_t, seq);
        DEFINE(IA64_GTOD_WALL_TIME_OFFSET,
                offsetof (struct fsyscall_gtod_data_t, wall_time));
        DEFINE(IA64_GTOD_MONO_TIME_OFFSET,
index 331d42bda77ae97f457b13f970aa83c40e11d4b0..fa77de7032b344cedf9562b5ed25f8fff6dac428 100644 (file)
@@ -174,7 +174,7 @@ ENTRY(fsys_set_tid_address)
        FSYS_RETURN
 END(fsys_set_tid_address)
 
-#if IA64_GTOD_LOCK_OFFSET !=0
+#if IA64_GTOD_SEQ_OFFSET !=0
 #error fsys_gettimeofday incompatible with changes to struct fsyscall_gtod_data_t
 #endif
 #if IA64_ITC_JITTER_OFFSET !=0
index 57d2ee6c83e1e637cd5c587f165834f980fb38a7..146b15b5fec30f34d4c78df1a390870b34781aaa 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 struct fsyscall_gtod_data_t {
-       seqlock_t       lock;
+       seqcount_t      seq;
        struct timespec wall_time;
        struct timespec monotonic_time;
        cycle_t         clk_mask;
index 43920de425f1efcac92203f84d4a67d8aa596457..8e991a0b5e356a0010836fe689b33653d8aa9ea6 100644 (file)
@@ -35,9 +35,7 @@
 
 static cycle_t itc_get_cycles(struct clocksource *cs);
 
-struct fsyscall_gtod_data_t fsyscall_gtod_data = {
-       .lock = __SEQLOCK_UNLOCKED(fsyscall_gtod_data.lock),
-};
+struct fsyscall_gtod_data_t fsyscall_gtod_data;
 
 struct itc_jitter_data_t itc_jitter_data;
 
@@ -460,9 +458,7 @@ void update_vsyscall_tz(void)
 void update_vsyscall(struct timespec *wall, struct timespec *wtm,
                        struct clocksource *c, u32 mult)
 {
-        unsigned long flags;
-
-        write_seqlock_irqsave(&fsyscall_gtod_data.lock, flags);
+       write_seqcount_begin(&fsyscall_gtod_data.seq);
 
         /* copy fsyscall clock data */
         fsyscall_gtod_data.clk_mask = c->mask;
@@ -485,6 +481,6 @@ void update_vsyscall(struct timespec *wall, struct timespec *wtm,
                fsyscall_gtod_data.monotonic_time.tv_sec++;
        }
 
-        write_sequnlock_irqrestore(&fsyscall_gtod_data.lock, flags);
+       write_seqcount_end(&fsyscall_gtod_data.seq);
 }