All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for John Stultz <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	torvalds@linux-foundation.org, peterz@infradead.org,
	sboyd@codeaurora.org, john.stultz@linaro.org, w@1wt.eu,
	khalasa@piap.pl, u.kleine-koenig@pengutronix.de,
	tglx@linutronix.de
Subject: [tip:core/urgent] seqlock: Use raw_ prefix instead of _no_lockdep
Date: Sun, 12 Jan 2014 10:42:26 -0800	[thread overview]
Message-ID: <tip-0c3351d451ae2fa438d5d1ed719fc43354fbffbb@git.kernel.org> (raw)
In-Reply-To: <1388704274-5278-1-git-send-email-john.stultz@linaro.org>

Commit-ID:  0c3351d451ae2fa438d5d1ed719fc43354fbffbb
Gitweb:     http://git.kernel.org/tip/0c3351d451ae2fa438d5d1ed719fc43354fbffbb
Author:     John Stultz <john.stultz@linaro.org>
AuthorDate: Thu, 2 Jan 2014 15:11:13 -0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sun, 12 Jan 2014 10:13:59 +0100

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>
---
 arch/x86/vdso/vclock_gettime.c |  8 ++++----
 include/linux/seqlock.h        | 27 +++++++++++++++++++--------
 2 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/arch/x86/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_gettime.c
index 2ada505..eb5d7a5 100644
--- a/arch/x86/vdso/vclock_gettime.c
+++ b/arch/x86/vdso/vclock_gettime.c
@@ -178,7 +178,7 @@ notrace static int __always_inline do_realtime(struct timespec *ts)
 
 	ts->tv_nsec = 0;
 	do {
-		seq = read_seqcount_begin_no_lockdep(&gtod->seq);
+		seq = raw_read_seqcount_begin(&gtod->seq);
 		mode = gtod->clock.vclock_mode;
 		ts->tv_sec = gtod->wall_time_sec;
 		ns = gtod->wall_time_snsec;
@@ -198,7 +198,7 @@ notrace static int do_monotonic(struct timespec *ts)
 
 	ts->tv_nsec = 0;
 	do {
-		seq = read_seqcount_begin_no_lockdep(&gtod->seq);
+		seq = raw_read_seqcount_begin(&gtod->seq);
 		mode = gtod->clock.vclock_mode;
 		ts->tv_sec = gtod->monotonic_time_sec;
 		ns = gtod->monotonic_time_snsec;
@@ -214,7 +214,7 @@ notrace static int do_realtime_coarse(struct timespec *ts)
 {
 	unsigned long seq;
 	do {
-		seq = read_seqcount_begin_no_lockdep(&gtod->seq);
+		seq = raw_read_seqcount_begin(&gtod->seq);
 		ts->tv_sec = gtod->wall_time_coarse.tv_sec;
 		ts->tv_nsec = gtod->wall_time_coarse.tv_nsec;
 	} while (unlikely(read_seqcount_retry(&gtod->seq, seq)));
@@ -225,7 +225,7 @@ notrace static int do_monotonic_coarse(struct timespec *ts)
 {
 	unsigned long seq;
 	do {
-		seq = read_seqcount_begin_no_lockdep(&gtod->seq);
+		seq = raw_read_seqcount_begin(&gtod->seq);
 		ts->tv_sec = gtod->monotonic_time_coarse.tv_sec;
 		ts->tv_nsec = gtod->monotonic_time_coarse.tv_nsec;
 	} while (unlikely(read_seqcount_retry(&gtod->seq, seq)));
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index cf87a24..535f158 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -117,15 +117,15 @@ repeat:
 }
 
 /**
- * read_seqcount_begin_no_lockdep - start seq-read critical section w/o lockdep
+ * raw_read_seqcount_begin - start seq-read critical section w/o lockdep
  * @s: pointer to seqcount_t
  * Returns: count to be passed to read_seqcount_retry
  *
- * read_seqcount_begin_no_lockdep opens a read critical section of the given
+ * raw_read_seqcount_begin opens a read critical section of the given
  * seqcount, but without any lockdep checking. Validity of the critical
  * section is tested by checking read_seqcount_retry function.
  */
-static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s)
+static inline unsigned raw_read_seqcount_begin(const seqcount_t *s)
 {
 	unsigned ret = __read_seqcount_begin(s);
 	smp_rmb();
@@ -144,7 +144,7 @@ static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s)
 static inline unsigned read_seqcount_begin(const seqcount_t *s)
 {
 	seqcount_lockdep_reader_access(s);
-	return read_seqcount_begin_no_lockdep(s);
+	return raw_read_seqcount_begin(s);
 }
 
 /**
@@ -206,14 +206,26 @@ static inline int read_seqcount_retry(const seqcount_t *s, unsigned start)
 }
 
 
+
+static inline void raw_write_seqcount_begin(seqcount_t *s)
+{
+	s->sequence++;
+	smp_wmb();
+}
+
+static inline void raw_write_seqcount_end(seqcount_t *s)
+{
+	smp_wmb();
+	s->sequence++;
+}
+
 /*
  * Sequence counter only version assumes that callers are using their
  * own mutexing.
  */
 static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass)
 {
-	s->sequence++;
-	smp_wmb();
+	raw_write_seqcount_begin(s);
 	seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_);
 }
 
@@ -225,8 +237,7 @@ static inline void write_seqcount_begin(seqcount_t *s)
 static inline void write_seqcount_end(seqcount_t *s)
 {
 	seqcount_release(&s->dep_map, 1, _RET_IP_);
-	smp_wmb();
-	s->sequence++;
+	raw_write_seqcount_end(s);
 }
 
 /**

  parent reply	other threads:[~2014-01-12 18:47 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-31 10:37 v3.13-rc6+ regression (ARM board) Krzysztof Hałasa
2013-12-31 10:37 ` Krzysztof Hałasa
2013-12-31 10:45 ` Willy Tarreau
2013-12-31 10:45   ` Willy Tarreau
2014-01-02 10:02   ` Krzysztof Hałasa
2014-01-02 10:02     ` Krzysztof Hałasa
2014-01-02 10:14     ` Uwe Kleine-König
2014-01-02 10:14       ` Uwe Kleine-König
2014-01-02 12:07       ` Krzysztof Hałasa
2014-01-02 12:07         ` Krzysztof Hałasa
2014-01-02 19:38         ` Linus Torvalds
2014-01-02 19:38           ` Linus Torvalds
2014-01-02 20:03           ` John Stultz
2014-01-02 20:03             ` John Stultz
2014-01-02 20:30             ` John Stultz
2014-01-02 20:30               ` John Stultz
2014-01-02 20:42               ` Stephen Boyd
2014-01-02 20:42                 ` Stephen Boyd
2014-01-02 20:52                 ` John Stultz
2014-01-02 20:52                   ` John Stultz
2014-01-02 20:43               ` Linus Torvalds
2014-01-02 20:43                 ` Linus Torvalds
2014-01-02 21:34                 ` John Stultz
2014-01-02 21:34                   ` John Stultz
2014-01-02 21:54                   ` [PATCH] sched_clock: Disable seqlock lockdep usage in sched_clock John Stultz
2014-01-02 21:54                     ` John Stultz
2014-01-02 22:15                     ` Linus Torvalds
2014-01-02 22:15                       ` Linus Torvalds
2014-01-02 22:21                       ` John Stultz
2014-01-02 22:21                         ` John Stultz
2014-01-02 23:11                         ` [PATCH 1/2] seqlock: Use raw_ prefix instead of _no_lockdep John Stultz
2014-01-02 23:11                           ` John Stultz
2014-01-02 23:11                           ` [PATCH 2/2] sched_clock: Disable seqlock lockdep usage in sched_clock John Stultz
2014-01-02 23:11                             ` John Stultz
2014-01-03  0:46                             ` Stephen Boyd
2014-01-03  0:46                               ` Stephen Boyd
2014-01-03  6:05                             ` Krzysztof Hałasa
2014-01-03  6:05                               ` Krzysztof Hałasa
2014-01-12 18:42                             ` [tip:core/urgent] sched_clock: Disable seqlock lockdep usage in sched_clock() tip-bot for John Stultz
2014-01-14 19:18                               ` John Stultz
2014-01-15  6:38                                 ` Ingo Molnar
2014-01-03  0:46                           ` [PATCH 1/2] seqlock: Use raw_ prefix instead of _no_lockdep Stephen Boyd
2014-01-03  0:46                             ` Stephen Boyd
2014-01-03  0:50                           ` Linus Torvalds
2014-01-03  0:50                             ` Linus Torvalds
2014-01-04  0:28                             ` John Stultz
2014-01-04  0:28                               ` John Stultz
2014-01-06 10:10                               ` Peter Zijlstra
2014-01-06 10:10                                 ` Peter Zijlstra
2014-01-12 18:42                           ` tip-bot for John Stultz [this message]
2014-01-03  6:01           ` v3.13-rc6+ regression (ARM board) Krzysztof Hałasa
2014-01-03  6:01             ` Krzysztof Hałasa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-0c3351d451ae2fa438d5d1ed719fc43354fbffbb@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=john.stultz@linaro.org \
    --cc=khalasa@piap.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sboyd@codeaurora.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.