From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com,
rostedt@goodmis.org, "Paul E. McKenney" <paulmck@kernel.org>
Subject: [PATCH rcu 1/7] doc: Emphasize the need for explicit RCU read-side markers
Date: Wed, 31 Aug 2022 11:06:19 -0700 [thread overview]
Message-ID: <20220831180625.2692892-1-paulmck@kernel.org> (raw)
In-Reply-To: <20220831180617.GA2692480@paulmck-ThinkPad-P17-Gen-1>
This commit updates checklist.rst to emphasize the need for explicit
markers for RCU read-side critical sections.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
Documentation/RCU/checklist.rst | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/Documentation/RCU/checklist.rst b/Documentation/RCU/checklist.rst
index 42cc5d891bd26..5eedef027d922 100644
--- a/Documentation/RCU/checklist.rst
+++ b/Documentation/RCU/checklist.rst
@@ -66,8 +66,13 @@ over a rather long period of time, but improvements are always welcome!
As a rough rule of thumb, any dereference of an RCU-protected
pointer must be covered by rcu_read_lock(), rcu_read_lock_bh(),
rcu_read_lock_sched(), or by the appropriate update-side lock.
- Disabling of preemption can serve as rcu_read_lock_sched(), but
- is less readable and prevents lockdep from detecting locking issues.
+ Explicit disabling of preemption (preempt_disable(), for example)
+ can serve as rcu_read_lock_sched(), but is less readable and
+ prevents lockdep from detecting locking issues.
+
+ Please not that you *cannot* rely on code known to be built
+ only in non-preemptible kernels. Such code can and will break,
+ especially in kernels built with CONFIG_PREEMPT_COUNT=y.
Letting RCU-protected pointers "leak" out of an RCU read-side
critical section is every bit as bad as letting them leak out
--
2.31.1.189.g2e36527f23
next prev parent reply other threads:[~2022-08-31 18:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-31 18:06 [PATCH rcu 0/7] RCU documentation updates for v6.1 Paul E. McKenney
2022-08-31 18:06 ` Paul E. McKenney [this message]
2022-08-31 18:06 ` [PATCH rcu 2/7] doc: Call out queue_rcu_work() for blocking RCU callbacks Paul E. McKenney
2022-08-31 18:06 ` [PATCH rcu 3/7] doc: Use rcu_barrier() to rate-limit " Paul E. McKenney
2022-08-31 18:06 ` [PATCH rcu 4/7] doc: Fix list: rcu_access_pointer() is not lockdep-checked Paul E. McKenney
2022-08-31 18:06 ` [PATCH rcu 5/7] doc: Update rcu_access_pointer() advice in rcu_dereference.rst Paul E. McKenney
2022-08-31 18:06 ` [PATCH rcu 6/7] doc: SLAB_TYPESAFE_BY_RCU uses cannot rely on spinlocks Paul E. McKenney
2022-08-31 18:06 ` [PATCH rcu 7/7] doc/rcu: Update LWN article URLs and add 2019 article Paul E. McKenney
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=20220831180625.2692892-1-paulmck@kernel.org \
--to=paulmck@kernel.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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
all inboxes | Powered by JetHome®