aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c54
1 files changed, 14 insertions, 40 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 5f79315f094e..1d36cbcce1b4 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -72,46 +72,20 @@
72 72
73/* Data structures. */ 73/* Data structures. */
74 74
75/* 75static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_data, rcu_data);
76 * In order to export the rcu_state name to the tracing tools, it 76struct rcu_state rcu_state = {
77 * needs to be added in the __tracepoint_string section. 77 .level = { &rcu_state.node[0] },
78 * This requires defining a separate variable tp_<sname>_varname 78 .rda = &rcu_data,
79 * that points to the string being used, and this will allow 79 .call = call_rcu,
80 * the tracing userspace tools to be able to decipher the string 80 .gp_state = RCU_GP_IDLE,
81 * address to the matching string. 81 .gp_seq = (0UL - 300UL) << RCU_SEQ_CTR_SHIFT,
82 */ 82 .barrier_mutex = __MUTEX_INITIALIZER(rcu_state.barrier_mutex),
83#ifdef CONFIG_TRACING 83 .name = RCU_NAME,
84# define DEFINE_RCU_TPS(sname) \ 84 .abbr = RCU_ABBR,
85static char sname##_varname[] = #sname; \ 85 .exp_mutex = __MUTEX_INITIALIZER(rcu_state.exp_mutex),
86static const char *tp_##sname##_varname __used __tracepoint_string = sname##_varname; 86 .exp_wake_mutex = __MUTEX_INITIALIZER(rcu_state.exp_wake_mutex),
87# define RCU_STATE_NAME(sname) sname##_varname 87 .ofl_lock = __SPIN_LOCK_UNLOCKED(rcu_state.ofl_lock),
88#else 88};
89# define DEFINE_RCU_TPS(sname)
90# define RCU_STATE_NAME(sname) __stringify(sname)
91#endif
92
93#define RCU_STATE_INITIALIZER(sname, sabbr, cr) \
94DEFINE_RCU_TPS(sname) \
95static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_data, rcu_data); \
96struct rcu_state rcu_state = { \
97 .level = { &rcu_state.node[0] }, \
98 .rda = &rcu_data, \
99 .call = cr, \
100 .gp_state = RCU_GP_IDLE, \
101 .gp_seq = (0UL - 300UL) << RCU_SEQ_CTR_SHIFT, \
102 .barrier_mutex = __MUTEX_INITIALIZER(rcu_state.barrier_mutex), \
103 .name = RCU_STATE_NAME(sname), \
104 .abbr = sabbr, \
105 .exp_mutex = __MUTEX_INITIALIZER(rcu_state.exp_mutex), \
106 .exp_wake_mutex = __MUTEX_INITIALIZER(rcu_state.exp_wake_mutex), \
107 .ofl_lock = __SPIN_LOCK_UNLOCKED(rcu_state.ofl_lock), \
108}
109
110#ifdef CONFIG_PREEMPT_RCU
111RCU_STATE_INITIALIZER(rcu_preempt, 'p', call_rcu);
112#else
113RCU_STATE_INITIALIZER(rcu_sched, 's', call_rcu);
114#endif
115 89
116static struct rcu_state *const rcu_state_p = &rcu_state; 90static struct rcu_state *const rcu_state_p = &rcu_state;
117static struct rcu_data __percpu *const rcu_data_p = &rcu_data; 91static struct rcu_data __percpu *const rcu_data_p = &rcu_data;