diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-01-31 17:00:41 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-02-21 12:06:08 -0500 |
commit | 236fefafe5d3d34b78ed2ccf5510909716112326 (patch) | |
tree | 9ff5ec129e59667341aa07120720b6e4a5ced4d9 /kernel/rcutree.c | |
parent | 2036d94a7b61ca5032ce90f2bda06afec0fe713e (diff) |
rcu: Call out dangers of expedited RCU primitives
The expedited RCU primitives can be quite useful, but they have some
high costs as well. This commit updates and creates docbook comments
calling out the costs, and updates the RCU documentation as well.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r-- | kernel/rcutree.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 708469a06860..df0e3c1bb68e 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -1961,15 +1961,21 @@ static int synchronize_sched_expedited_cpu_stop(void *data) | |||
1961 | return 0; | 1961 | return 0; |
1962 | } | 1962 | } |
1963 | 1963 | ||
1964 | /* | 1964 | /** |
1965 | * Wait for an rcu-sched grace period to elapse, but use "big hammer" | 1965 | * synchronize_sched_expedited - Brute-force RCU-sched grace period |
1966 | * approach to force grace period to end quickly. This consumes | 1966 | * |
1967 | * significant time on all CPUs, and is thus not recommended for | 1967 | * Wait for an RCU-sched grace period to elapse, but use a "big hammer" |
1968 | * any sort of common-case code. | 1968 | * approach to force the grace period to end quickly. This consumes |
1969 | * significant time on all CPUs and is unfriendly to real-time workloads, | ||
1970 | * so is thus not recommended for any sort of common-case code. In fact, | ||
1971 | * if you are using synchronize_sched_expedited() in a loop, please | ||
1972 | * restructure your code to batch your updates, and then use a single | ||
1973 | * synchronize_sched() instead. | ||
1969 | * | 1974 | * |
1970 | * Note that it is illegal to call this function while holding any | 1975 | * Note that it is illegal to call this function while holding any lock |
1971 | * lock that is acquired by a CPU-hotplug notifier. Failing to | 1976 | * that is acquired by a CPU-hotplug notifier. And yes, it is also illegal |
1972 | * observe this restriction will result in deadlock. | 1977 | * to call this function from a CPU-hotplug notifier. Failing to observe |
1978 | * these restriction will result in deadlock. | ||
1973 | * | 1979 | * |
1974 | * This implementation can be thought of as an application of ticket | 1980 | * This implementation can be thought of as an application of ticket |
1975 | * locking to RCU, with sync_sched_expedited_started and | 1981 | * locking to RCU, with sync_sched_expedited_started and |