From a94e19127b339afb171c033215a5c31b5ec026d0 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Sun, 23 Jan 2011 22:35:45 -0800 Subject: [PATCH] --- yaml --- r: 234943 b: refs/heads/master c: fea651267e52a88e7b81e01b6717d968254b6ddb h: refs/heads/master i: 234941: dcc83b1cbca57355b01240f3b75e074c1b732484 234939: fa7c4c6e441d8905e0f1fcf28a2c5d42cc1a5231 234935: 02b02187b946c9d6a0461b7afc2a265f77398db0 234927: 368e2470743a6bf5613d5e45d0ba1e65c3cfcc6e 234911: 72ea904077acc733c0abac6f546f451870dcd110 234879: e39006e3ef7178196026ee5ef8452b682f1ddada v: v3 --- [refs] | 2 +- trunk/Documentation/RCU/whatisRCU.txt | 31 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f027cb8afdbe..4fdc2b4b6ec1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 37743de384951ef97c040e69039820c987849501 +refs/heads/master: fea651267e52a88e7b81e01b6717d968254b6ddb diff --git a/trunk/Documentation/RCU/whatisRCU.txt b/trunk/Documentation/RCU/whatisRCU.txt index cfaac34c4557..6ef692667e2f 100644 --- a/trunk/Documentation/RCU/whatisRCU.txt +++ b/trunk/Documentation/RCU/whatisRCU.txt @@ -849,6 +849,37 @@ All: lockdep-checked RCU-protected pointer access See the comment headers in the source code (or the docbook generated from them) for more information. +However, given that there are no fewer than four families of RCU APIs +in the Linux kernel, how do you choose which one to use? The following +list can be helpful: + +a. Will readers need to block? If so, you need SRCU. + +b. What about the -rt patchset? If readers would need to block + in an non-rt kernel, you need SRCU. If readers would block + in a -rt kernel, but not in a non-rt kernel, SRCU is not + necessary. + +c. Do you need to treat NMI handlers, hardirq handlers, + and code segments with preemption disabled (whether + via preempt_disable(), local_irq_save(), local_bh_disable(), + or some other mechanism) as if they were explicit RCU readers? + If so, you need RCU-sched. + +d. Do you need RCU grace periods to complete even in the face + of softirq monopolization of one or more of the CPUs? For + example, is your code subject to network-based denial-of-service + attacks? If so, you need RCU-bh. + +e. Is your workload too update-intensive for normal use of + RCU, but inappropriate for other synchronization mechanisms? + If so, consider SLAB_DESTROY_BY_RCU. But please be careful! + +f. Otherwise, use RCU. + +Of course, this all assumes that you have determined that RCU is in fact +the right tool for your job. + 8. ANSWERS TO QUICK QUIZZES