aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcupdate.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rcupdate.c')
-rw-r--r--kernel/rcupdate.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index c09605f8d16c..a4e329d92883 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -39,18 +39,12 @@
39#include <linux/sched.h> 39#include <linux/sched.h>
40#include <asm/atomic.h> 40#include <asm/atomic.h>
41#include <linux/bitops.h> 41#include <linux/bitops.h>
42#include <linux/completion.h>
43#include <linux/percpu.h> 42#include <linux/percpu.h>
44#include <linux/notifier.h> 43#include <linux/notifier.h>
45#include <linux/cpu.h> 44#include <linux/cpu.h>
46#include <linux/mutex.h> 45#include <linux/mutex.h>
47#include <linux/module.h> 46#include <linux/module.h>
48 47
49struct rcu_synchronize {
50 struct rcu_head head;
51 struct completion completion;
52};
53
54static DEFINE_PER_CPU(struct rcu_head, rcu_barrier_head) = {NULL}; 48static DEFINE_PER_CPU(struct rcu_head, rcu_barrier_head) = {NULL};
55static atomic_t rcu_barrier_cpu_count; 49static atomic_t rcu_barrier_cpu_count;
56static DEFINE_MUTEX(rcu_barrier_mutex); 50static DEFINE_MUTEX(rcu_barrier_mutex);
@@ -60,7 +54,7 @@ static struct completion rcu_barrier_completion;
60 * Awaken the corresponding synchronize_rcu() instance now that a 54 * Awaken the corresponding synchronize_rcu() instance now that a
61 * grace period has elapsed. 55 * grace period has elapsed.
62 */ 56 */
63static void wakeme_after_rcu(struct rcu_head *head) 57void wakeme_after_rcu(struct rcu_head *head)
64{ 58{
65 struct rcu_synchronize *rcu; 59 struct rcu_synchronize *rcu;
66 60
@@ -77,17 +71,7 @@ static void wakeme_after_rcu(struct rcu_head *head)
77 * sections are delimited by rcu_read_lock() and rcu_read_unlock(), 71 * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
78 * and may be nested. 72 * and may be nested.
79 */ 73 */
80void synchronize_rcu(void) 74synchronize_rcu_xxx(synchronize_rcu, call_rcu)
81{
82 struct rcu_synchronize rcu;
83
84 init_completion(&rcu.completion);
85 /* Will wake me after RCU finished */
86 call_rcu(&rcu.head, wakeme_after_rcu);
87
88 /* Wait for it */
89 wait_for_completion(&rcu.completion);
90}
91EXPORT_SYMBOL_GPL(synchronize_rcu); 75EXPORT_SYMBOL_GPL(synchronize_rcu);
92 76
93static void rcu_barrier_callback(struct rcu_head *notused) 77static void rcu_barrier_callback(struct rcu_head *notused)