Lines Matching full:rcu
4 Review Checklist for RCU Patches
9 that make use of RCU. Violating any of the rules listed below will
14 0. Is RCU being applied to a read-mostly situation? If the data
17 performance measurements show that RCU is nonetheless the right
18 tool for the job. Yes, RCU does reduce read-side overhead by
20 of RCU will do much more reading than updating.
22 Another exception is where performance is not an issue, and RCU
27 Yet another exception is where the low real-time latency of RCU's
30 One final exception is where RCU readers are used to prevent
40 RCU does allow *readers* to run (almost) naked, but *writers* must
59 2. Do the RCU read-side critical sections make proper use of
66 As a rough rule of thumb, any dereference of an RCU-protected
77 Letting RCU-protected pointers "leak" out of an RCU read-side
81 *before* letting them out of the RCU read-side critical section.
85 The whole point of RCU is to permit readers to run without
90 a. Use the RCU variants of the list and hlist update
92 an RCU-protected list. Alternatively, use the other
93 RCU-protected data structures that have been added to
110 appear to be atomic to RCU readers, nor will sequences
130 reordered to precede earlier stores. RCU code must take all of
141 code know exactly which pointers are protected by RCU.
158 of an RCU read-side critical section. See lockdep.rst
180 in their respective types of RCU-protected lists.
183 type of RCU-protected linked lists.
189 be traversed by an RCU read-side critical section.
221 7. As of v4.20, a given kernel implements only one RCU flavor, which
222 is RCU-sched for PREEMPTION=n and RCU-preempt for PREEMPTION=y.
232 srcu_struct. The rules for the expedited RCU grace-period-wait
249 network-driver NAPI (softirq) context. BPF relies heavily on RCU
278 used by the RCU-protected data structure, including
292 RCU grace period. There are of course many other
317 offload all of its RCU callbacks onto a single CPU, or if the
320 9. All RCU list-traversal primitives, which include
322 list_for_each_safe_rcu(), must be either within an RCU read-side
324 locks. RCU read-side critical sections are delimited by
330 The reason that it is permissible to use RCU list-traversal
343 10. Conversely, if you are in an RCU read-side critical section,
349 11. Any lock acquired by an RCU callback must be acquired elsewhere
353 the RCU softirq handler happens to run your RCU callback while
356 12. RCU callbacks can be and are executed in parallel. In many cases,
364 Do not assume that RCU callbacks will be executed on the same
366 For example, if a given CPU goes offline while having an RCU
367 callback pending, then that RCU callback will execute on some
368 surviving CPU. (If this was not the case, a self-spawning RCU
371 have their RCU callbacks executed on some other CPUs, in fact,
375 13. Unlike other forms of RCU, it *is* permissible to block in an
377 and srcu_read_unlock()), hence the "SRCU": "sleepable RCU".
379 sections, you should be using RCU rather than SRCU, because RCU
382 Also unlike other forms of RCU, explicit initialization and
396 system than RCU would be if RCU's read-side critical sections
404 being globally amortized as they are for other forms of RCU.
416 other forms of RCU, but instead of rcu_dereference() you should
431 15. The various RCU read-side primitives do *not* necessarily contain
433 and the compiler to freely reorder code into and out of RCU
435 RCU update-side primitives to deal with this.
441 __rcu sparse checks to validate your RCU code. These can help
445 check that accesses to RCU-protected data
446 structures are carried out under the proper RCU
453 same object to call_rcu() (or friends) before an RCU
458 tag the pointer to the RCU-protected data
486 So if you need to wait for both an RCU grace period and for