linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: a.darwish@linutronix.de
Cc: bigeasy@linutronix.de, peterz@infradead.org, tglx@linutronix.de,
	shung-hsi.yu@suse.com, dave@stgolabs.net,
	linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: [PATCH v2] seqlock,lockdep: Only check for preemption_disabled in non-rt
Date: Fri,  7 May 2021 16:47:13 -0700	[thread overview]
Message-ID: <20210507234713.86097-1-dave@stgolabs.net> (raw)
In-Reply-To: <20210507233951.78950-1-dave@stgolabs.net>

This silences the writer hitting this nonsensical warning on PREEMPT_RT.

Reported-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---

v2: Resending because I had left out some small comments I had meant to add.

 include/linux/seqlock.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index f61e34fbaaea..2ce3e1efc9a9 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -268,7 +268,9 @@ static inline bool __seqprop_preemptible(const seqcount_t *s)
 
 static inline void __seqprop_assert(const seqcount_t *s)
 {
+#ifndef CONFIG_PREEMPT_RT
 	lockdep_assert_preemption_disabled();
+#endif
 }
 
 #define __SEQ_RT	IS_ENABLED(CONFIG_PREEMPT_RT)
@@ -529,6 +531,8 @@ static inline void do_write_seqcount_begin_nested(seqcount_t *s, int subclass)
  * only if the seqcount write serialization lock is associated, and
  * preemptible.  If readers can be invoked from hardirq or softirq
  * context, interrupts or bottom halves must be respectively disabled.
+ * The PREEMPT_RT case relies on the reader serializing via LOCK+UNLOCK,
+ * so the context is preemptible.
  */
 #define write_seqcount_begin(s)						\
 do {									\
-- 
2.26.2


  reply	other threads:[~2021-05-07 23:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 23:39 [PATCH] seqlock,lockdep: Only check for preemption_disabled in non-rt Davidlohr Bueso
2021-05-07 23:47 ` Davidlohr Bueso [this message]
2021-05-12  8:44   ` [PATCH v2] " Peter Zijlstra
2021-05-13 19:53     ` Davidlohr Bueso
2021-05-14  4:55       ` Ahmed S. Darwish
2021-05-12  9:47 ` [PATCH] " Ahmed S. Darwish

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=20210507234713.86097-1-dave@stgolabs.net \
    --to=dave@stgolabs.net \
    --cc=a.darwish@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=dbueso@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=shung-hsi.yu@suse.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).