aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rcutree_plugin.h')
-rw-r--r--kernel/rcutree_plugin.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 0bdb592eee66..1d295c789d3d 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -425,6 +425,30 @@ void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
425} 425}
426EXPORT_SYMBOL_GPL(call_rcu); 426EXPORT_SYMBOL_GPL(call_rcu);
427 427
428/**
429 * synchronize_rcu - wait until a grace period has elapsed.
430 *
431 * Control will return to the caller some time after a full grace
432 * period has elapsed, in other words after all currently executing RCU
433 * read-side critical sections have completed. RCU read-side critical
434 * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
435 * and may be nested.
436 */
437void synchronize_rcu(void)
438{
439 struct rcu_synchronize rcu;
440
441 if (!rcu_scheduler_active)
442 return;
443
444 init_completion(&rcu.completion);
445 /* Will wake me after RCU finished. */
446 call_rcu(&rcu.head, wakeme_after_rcu);
447 /* Wait for it. */
448 wait_for_completion(&rcu.completion);
449}
450EXPORT_SYMBOL_GPL(synchronize_rcu);
451
428/* 452/*
429 * Wait for an rcu-preempt grace period. We are supposed to expedite the 453 * Wait for an rcu-preempt grace period. We are supposed to expedite the
430 * grace period, but this is the crude slow compatability hack, so just 454 * grace period, but this is the crude slow compatability hack, so just