diff options
Diffstat (limited to 'kernel/rcupdate.c')
-rw-r--r-- | kernel/rcupdate.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index 9b7fd4723878..f1125c1a6321 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c | |||
@@ -44,14 +44,43 @@ | |||
44 | #include <linux/cpu.h> | 44 | #include <linux/cpu.h> |
45 | #include <linux/mutex.h> | 45 | #include <linux/mutex.h> |
46 | #include <linux/module.h> | 46 | #include <linux/module.h> |
47 | #include <linux/kernel_stat.h> | ||
47 | 48 | ||
48 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 49 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
49 | static struct lock_class_key rcu_lock_key; | 50 | static struct lock_class_key rcu_lock_key; |
50 | struct lockdep_map rcu_lock_map = | 51 | struct lockdep_map rcu_lock_map = |
51 | STATIC_LOCKDEP_MAP_INIT("rcu_read_lock", &rcu_lock_key); | 52 | STATIC_LOCKDEP_MAP_INIT("rcu_read_lock", &rcu_lock_key); |
52 | EXPORT_SYMBOL_GPL(rcu_lock_map); | 53 | EXPORT_SYMBOL_GPL(rcu_lock_map); |
54 | |||
55 | static struct lock_class_key rcu_bh_lock_key; | ||
56 | struct lockdep_map rcu_bh_lock_map = | ||
57 | STATIC_LOCKDEP_MAP_INIT("rcu_read_lock_bh", &rcu_bh_lock_key); | ||
58 | EXPORT_SYMBOL_GPL(rcu_bh_lock_map); | ||
59 | |||
60 | static struct lock_class_key rcu_sched_lock_key; | ||
61 | struct lockdep_map rcu_sched_lock_map = | ||
62 | STATIC_LOCKDEP_MAP_INIT("rcu_read_lock_sched", &rcu_sched_lock_key); | ||
63 | EXPORT_SYMBOL_GPL(rcu_sched_lock_map); | ||
53 | #endif | 64 | #endif |
54 | 65 | ||
66 | int rcu_scheduler_active __read_mostly; | ||
67 | EXPORT_SYMBOL_GPL(rcu_scheduler_active); | ||
68 | |||
69 | /* | ||
70 | * This function is invoked towards the end of the scheduler's initialization | ||
71 | * process. Before this is called, the idle task might contain | ||
72 | * RCU read-side critical sections (during which time, this idle | ||
73 | * task is booting the system). After this function is called, the | ||
74 | * idle tasks are prohibited from containing RCU read-side critical | ||
75 | * sections. | ||
76 | */ | ||
77 | void rcu_scheduler_starting(void) | ||
78 | { | ||
79 | WARN_ON(num_online_cpus() != 1); | ||
80 | WARN_ON(nr_context_switches() > 0); | ||
81 | rcu_scheduler_active = 1; | ||
82 | } | ||
83 | |||
55 | /* | 84 | /* |
56 | * Awaken the corresponding synchronize_rcu() instance now that a | 85 | * Awaken the corresponding synchronize_rcu() instance now that a |
57 | * grace period has elapsed. | 86 | * grace period has elapsed. |