aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcupdate.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@us.ibm.com>2005-05-01 11:59:04 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 11:59:04 -0400
commit9b06e818985d139fd9e82c28297f7744e1b484e1 (patch)
tree3cd2ba33b22fc2812f714f86ea52c68704f8e2c3 /kernel/rcupdate.c
parent512345be2549308b8ae8e85a3ff7f6d56a38e5f6 (diff)
[PATCH] Deprecate synchronize_kernel, GPL replacement
The synchronize_kernel() primitive is used for quite a few different purposes: waiting for RCU readers, waiting for NMIs, waiting for interrupts, and so on. This makes RCU code harder to read, since synchronize_kernel() might or might not have matching rcu_read_lock()s. This patch creates a new synchronize_rcu() that is to be used for RCU readers and a new synchronize_sched() that is used for the rest. These two new primitives currently have the same implementation, but this is might well change with additional real-time support. Both new primitives are GPL-only, the old primitive is deprecated. Signed-off-by: Paul E. McKenney <paulmck@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/rcupdate.c')
-rw-r--r--kernel/rcupdate.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index ad497722f04f..f436993bd590 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -444,15 +444,18 @@ static void wakeme_after_rcu(struct rcu_head *head)
444} 444}
445 445
446/** 446/**
447 * synchronize_kernel - wait until a grace period has elapsed. 447 * synchronize_rcu - wait until a grace period has elapsed.
448 * 448 *
449 * Control will return to the caller some time after a full grace 449 * Control will return to the caller some time after a full grace
450 * period has elapsed, in other words after all currently executing RCU 450 * period has elapsed, in other words after all currently executing RCU
451 * read-side critical sections have completed. RCU read-side critical 451 * read-side critical sections have completed. RCU read-side critical
452 * sections are delimited by rcu_read_lock() and rcu_read_unlock(), 452 * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
453 * and may be nested. 453 * and may be nested.
454 *
455 * If your read-side code is not protected by rcu_read_lock(), do -not-
456 * use synchronize_rcu().
454 */ 457 */
455void synchronize_kernel(void) 458void synchronize_rcu(void)
456{ 459{
457 struct rcu_synchronize rcu; 460 struct rcu_synchronize rcu;
458 461
@@ -464,7 +467,16 @@ void synchronize_kernel(void)
464 wait_for_completion(&rcu.completion); 467 wait_for_completion(&rcu.completion);
465} 468}
466 469
470/*
471 * Deprecated, use synchronize_rcu() or synchronize_sched() instead.
472 */
473void synchronize_kernel(void)
474{
475 synchronize_rcu();
476}
477
467module_param(maxbatch, int, 0); 478module_param(maxbatch, int, 0);
468EXPORT_SYMBOL(call_rcu); /* WARNING: GPL-only in April 2006. */ 479EXPORT_SYMBOL(call_rcu); /* WARNING: GPL-only in April 2006. */
469EXPORT_SYMBOL(call_rcu_bh); /* WARNING: GPL-only in April 2006. */ 480EXPORT_SYMBOL(call_rcu_bh); /* WARNING: GPL-only in April 2006. */
481EXPORT_SYMBOL_GPL(synchronize_rcu);
470EXPORT_SYMBOL(synchronize_kernel); /* WARNING: GPL-only in April 2006. */ 482EXPORT_SYMBOL(synchronize_kernel); /* WARNING: GPL-only in April 2006. */