Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

seqlock: Use raw_ prefix instead of _no_lockdep

Linus disliked the _no_lockdep() naming, so instead
use the more-consistent raw_* prefix to the non-lockdep
enabled seqcount methods.

This also adds raw_ methods for the write operations
as well, which will be utilized in a following patch.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Krzysztof Hałasa <khalasa@piap.pl>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Willy Tarreau <w@1wt.eu>
Link: http://lkml.kernel.org/r/1388704274-5278-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

John Stultz and committed by
Ingo Molnar
0c3351d4 228fdc08

+23 -12
+4 -4
arch/x86/vdso/vclock_gettime.c
··· 178 178 179 179 ts->tv_nsec = 0; 180 180 do { 181 - seq = read_seqcount_begin_no_lockdep(&gtod->seq); 181 + seq = raw_read_seqcount_begin(&gtod->seq); 182 182 mode = gtod->clock.vclock_mode; 183 183 ts->tv_sec = gtod->wall_time_sec; 184 184 ns = gtod->wall_time_snsec; ··· 198 198 199 199 ts->tv_nsec = 0; 200 200 do { 201 - seq = read_seqcount_begin_no_lockdep(&gtod->seq); 201 + seq = raw_read_seqcount_begin(&gtod->seq); 202 202 mode = gtod->clock.vclock_mode; 203 203 ts->tv_sec = gtod->monotonic_time_sec; 204 204 ns = gtod->monotonic_time_snsec; ··· 214 214 { 215 215 unsigned long seq; 216 216 do { 217 - seq = read_seqcount_begin_no_lockdep(&gtod->seq); 217 + seq = raw_read_seqcount_begin(&gtod->seq); 218 218 ts->tv_sec = gtod->wall_time_coarse.tv_sec; 219 219 ts->tv_nsec = gtod->wall_time_coarse.tv_nsec; 220 220 } while (unlikely(read_seqcount_retry(&gtod->seq, seq))); ··· 225 225 { 226 226 unsigned long seq; 227 227 do { 228 - seq = read_seqcount_begin_no_lockdep(&gtod->seq); 228 + seq = raw_read_seqcount_begin(&gtod->seq); 229 229 ts->tv_sec = gtod->monotonic_time_coarse.tv_sec; 230 230 ts->tv_nsec = gtod->monotonic_time_coarse.tv_nsec; 231 231 } while (unlikely(read_seqcount_retry(&gtod->seq, seq)));
+19 -8
include/linux/seqlock.h
··· 117 117 } 118 118 119 119 /** 120 - * read_seqcount_begin_no_lockdep - start seq-read critical section w/o lockdep 120 + * raw_read_seqcount_begin - start seq-read critical section w/o lockdep 121 121 * @s: pointer to seqcount_t 122 122 * Returns: count to be passed to read_seqcount_retry 123 123 * 124 - * read_seqcount_begin_no_lockdep opens a read critical section of the given 124 + * raw_read_seqcount_begin opens a read critical section of the given 125 125 * seqcount, but without any lockdep checking. Validity of the critical 126 126 * section is tested by checking read_seqcount_retry function. 127 127 */ 128 - static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) 128 + static inline unsigned raw_read_seqcount_begin(const seqcount_t *s) 129 129 { 130 130 unsigned ret = __read_seqcount_begin(s); 131 131 smp_rmb(); ··· 144 144 static inline unsigned read_seqcount_begin(const seqcount_t *s) 145 145 { 146 146 seqcount_lockdep_reader_access(s); 147 - return read_seqcount_begin_no_lockdep(s); 147 + return raw_read_seqcount_begin(s); 148 148 } 149 149 150 150 /** ··· 206 206 } 207 207 208 208 209 + 210 + static inline void raw_write_seqcount_begin(seqcount_t *s) 211 + { 212 + s->sequence++; 213 + smp_wmb(); 214 + } 215 + 216 + static inline void raw_write_seqcount_end(seqcount_t *s) 217 + { 218 + smp_wmb(); 219 + s->sequence++; 220 + } 221 + 209 222 /* 210 223 * Sequence counter only version assumes that callers are using their 211 224 * own mutexing. 212 225 */ 213 226 static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass) 214 227 { 215 - s->sequence++; 216 - smp_wmb(); 228 + raw_write_seqcount_begin(s); 217 229 seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_); 218 230 } 219 231 ··· 237 225 static inline void write_seqcount_end(seqcount_t *s) 238 226 { 239 227 seqcount_release(&s->dep_map, 1, _RET_IP_); 240 - smp_wmb(); 241 - s->sequence++; 228 + raw_write_seqcount_end(s); 242 229 } 243 230 244 231 /**