summaryrefslogtreecommitdiff
path: root/Documentation/locking
diff options
context:
space:
mode:
authorFederico Vaga <federico.vaga@vaga.pv.it>2019-09-08 08:29:01 +0200
committerJonathan Corbet <corbet@lwn.net>2019-09-14 01:53:27 -0600
commit19ad5f79f92e01375070009439c9f3ae22dc6b22 (patch)
tree7cd775f26ab313821e461031a1b8c13e4fe3077f /Documentation/locking
parentd62e8055a596b3d3f11c1643ba18a9cbf093a0b9 (diff)
doc:lock: remove reference to clever use of read-write lock
Remove the clever example about read-write lock because this type of lock is not recommended anymore (according to the very same document). So there is no reason to teach clever things that people should not do. Signed-off-by: Federico Vaga <federico.vaga@vaga.pv.it> Acked-by: Will Deacon <will@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/locking')
-rw-r--r--Documentation/locking/spinlocks.rst12
1 files changed, 0 insertions, 12 deletions
diff --git a/Documentation/locking/spinlocks.rst b/Documentation/locking/spinlocks.rst
index e93ec6645238..66e3792f8a36 100644
--- a/Documentation/locking/spinlocks.rst
+++ b/Documentation/locking/spinlocks.rst
@@ -139,18 +139,6 @@ on other CPU's, because an interrupt on another CPU doesn't interrupt the
CPU that holds the lock, so the lock-holder can continue and eventually
releases the lock).
-Note that you can be clever with read-write locks and interrupts. For
-example, if you know that the interrupt only ever gets a read-lock, then
-you can use a non-irq version of read locks everywhere - because they
-don't block on each other (and thus there is no dead-lock wrt interrupts.
-But when you do the write-lock, you have to use the irq-safe version.
-
-For an example of being clever with rw-locks, see the "waitqueue_lock"
-handling in kernel/sched/core.c - nothing ever _changes_ a wait-queue from
-within an interrupt, they only read the queue in order to know whom to
-wake up. So read-locks are safe (which is good: they are very common
-indeed), while write-locks need to protect themselves against interrupts.
-
Linus
----