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

Configure Feed

Select the types of activity you want to include in your feed.

docs: RCU: Convert lockdep.txt to ReST

- Add a SPDX header;
- Adjust document title;
- Mark literal blocks as such;
- Add it to RCU/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

authored by

Mauro Carvalho Chehab and committed by
Paul E. McKenney
058cc23b a3b0a79f

+9 -4
+1
Documentation/RCU/index.rst
··· 11 11 12 12 arrayRCU 13 13 checklist 14 + lockdep 14 15 lockdep-splat 15 16 rcubarrier 16 17 rcu_dereference
+8 -4
Documentation/RCU/lockdep.txt Documentation/RCU/lockdep.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + ======================== 1 4 RCU and lockdep checking 5 + ======================== 2 6 3 7 All flavors of RCU have lockdep checking available, so that lockdep is 4 8 aware of when each task enters and leaves any flavor of RCU read-side ··· 12 8 deadlocks and the like. 13 9 14 10 In addition, RCU provides the following primitives that check lockdep's 15 - state: 11 + state:: 16 12 17 13 rcu_read_lock_held() for normal RCU. 18 14 rcu_read_lock_bh_held() for RCU-bh. ··· 67 63 The rcu_dereference_check() check expression can be any boolean 68 64 expression, but would normally include a lockdep expression. However, 69 65 any boolean expression can be used. For a moderately ornate example, 70 - consider the following: 66 + consider the following:: 71 67 72 68 file = rcu_dereference_check(fdt->fd[fd], 73 69 lockdep_is_held(&files->file_lock) || ··· 86 82 any change from taking place, and finally, in case (3) the current task 87 83 is the only task accessing the file_struct, again preventing any change 88 84 from taking place. If the above statement was invoked only from updater 89 - code, it could instead be written as follows: 85 + code, it could instead be written as follows:: 90 86 91 87 file = rcu_dereference_protected(fdt->fd[fd], 92 88 lockdep_is_held(&files->file_lock) || ··· 109 105 110 106 For example, the workqueue for_each_pwq() macro is intended to be used 111 107 either within an RCU read-side critical section or with wq->mutex held. 112 - It is thus implemented as follows: 108 + It is thus implemented as follows:: 113 109 114 110 #define for_each_pwq(pwq, wq) 115 111 list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node,