diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-03-27 13:11:15 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-06-10 16:45:51 -0400 |
commit | 9dc5ad32488a75504349372330cc228d4dd678db (patch) | |
tree | 794a5a4ac485fa4e6141dc6f14d23b0963c4bbab /kernel | |
parent | 58c4e69d43df91fd6a55bc070474aad6b7cfb18d (diff) |
rcu: Simplify RCU_TINY RCU callback invocation
TINY_PREEMPT_RCU could use a kthread to handle RCU callback invocation,
which required an API to abstract kthread vs. softirq invocation.
Now that TINY_PREEMPT_RCU is no longer with us, this commit retires
this API in favor of direct use of the relevant softirq primitives.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rcutiny.c | 14 | ||||
-rw-r--r-- | kernel/rcutiny_plugin.h | 33 |
2 files changed, 9 insertions, 38 deletions
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c index 7fc2339b0859..4adc9e26da34 100644 --- a/kernel/rcutiny.c +++ b/kernel/rcutiny.c | |||
@@ -44,7 +44,6 @@ | |||
44 | 44 | ||
45 | /* Forward declarations for rcutiny_plugin.h. */ | 45 | /* Forward declarations for rcutiny_plugin.h. */ |
46 | struct rcu_ctrlblk; | 46 | struct rcu_ctrlblk; |
47 | static void invoke_rcu_callbacks(void); | ||
48 | static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp); | 47 | static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp); |
49 | static void rcu_process_callbacks(struct softirq_action *unused); | 48 | static void rcu_process_callbacks(struct softirq_action *unused); |
50 | static void __call_rcu(struct rcu_head *head, | 49 | static void __call_rcu(struct rcu_head *head, |
@@ -227,7 +226,7 @@ void rcu_sched_qs(int cpu) | |||
227 | local_irq_save(flags); | 226 | local_irq_save(flags); |
228 | if (rcu_qsctr_help(&rcu_sched_ctrlblk) + | 227 | if (rcu_qsctr_help(&rcu_sched_ctrlblk) + |
229 | rcu_qsctr_help(&rcu_bh_ctrlblk)) | 228 | rcu_qsctr_help(&rcu_bh_ctrlblk)) |
230 | invoke_rcu_callbacks(); | 229 | raise_softirq(RCU_SOFTIRQ); |
231 | local_irq_restore(flags); | 230 | local_irq_restore(flags); |
232 | } | 231 | } |
233 | 232 | ||
@@ -240,7 +239,7 @@ void rcu_bh_qs(int cpu) | |||
240 | 239 | ||
241 | local_irq_save(flags); | 240 | local_irq_save(flags); |
242 | if (rcu_qsctr_help(&rcu_bh_ctrlblk)) | 241 | if (rcu_qsctr_help(&rcu_bh_ctrlblk)) |
243 | invoke_rcu_callbacks(); | 242 | raise_softirq(RCU_SOFTIRQ); |
244 | local_irq_restore(flags); | 243 | local_irq_restore(flags); |
245 | } | 244 | } |
246 | 245 | ||
@@ -277,7 +276,7 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp) | |||
277 | ACCESS_ONCE(rcp->rcucblist), | 276 | ACCESS_ONCE(rcp->rcucblist), |
278 | need_resched(), | 277 | need_resched(), |
279 | is_idle_task(current), | 278 | is_idle_task(current), |
280 | rcu_is_callbacks_kthread())); | 279 | false)); |
281 | return; | 280 | return; |
282 | } | 281 | } |
283 | 282 | ||
@@ -307,7 +306,7 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp) | |||
307 | RCU_TRACE(rcu_trace_sub_qlen(rcp, cb_count)); | 306 | RCU_TRACE(rcu_trace_sub_qlen(rcp, cb_count)); |
308 | RCU_TRACE(trace_rcu_batch_end(rcp->name, cb_count, 0, need_resched(), | 307 | RCU_TRACE(trace_rcu_batch_end(rcp->name, cb_count, 0, need_resched(), |
309 | is_idle_task(current), | 308 | is_idle_task(current), |
310 | rcu_is_callbacks_kthread())); | 309 | false)); |
311 | } | 310 | } |
312 | 311 | ||
313 | static void rcu_process_callbacks(struct softirq_action *unused) | 312 | static void rcu_process_callbacks(struct softirq_action *unused) |
@@ -379,3 +378,8 @@ void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *rcu)) | |||
379 | __call_rcu(head, func, &rcu_bh_ctrlblk); | 378 | __call_rcu(head, func, &rcu_bh_ctrlblk); |
380 | } | 379 | } |
381 | EXPORT_SYMBOL_GPL(call_rcu_bh); | 380 | EXPORT_SYMBOL_GPL(call_rcu_bh); |
381 | |||
382 | void rcu_init(void) | ||
383 | { | ||
384 | open_softirq(RCU_SOFTIRQ, rcu_process_callbacks); | ||
385 | } | ||
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h index bfe992407803..36fd83c544c8 100644 --- a/kernel/rcutiny_plugin.h +++ b/kernel/rcutiny_plugin.h | |||
@@ -102,39 +102,6 @@ static void check_cpu_stalls(void) | |||
102 | RCU_TRACE(check_cpu_stall_preempt()); | 102 | RCU_TRACE(check_cpu_stall_preempt()); |
103 | } | 103 | } |
104 | 104 | ||
105 | /* Hold off callback invocation until early_initcall() time. */ | ||
106 | static int rcu_scheduler_fully_active __read_mostly; | ||
107 | |||
108 | /* | ||
109 | * Start up softirq processing of callbacks. | ||
110 | */ | ||
111 | void invoke_rcu_callbacks(void) | ||
112 | { | ||
113 | if (rcu_scheduler_fully_active) | ||
114 | raise_softirq(RCU_SOFTIRQ); | ||
115 | } | ||
116 | |||
117 | #ifdef CONFIG_RCU_TRACE | ||
118 | |||
119 | /* | ||
120 | * There is no callback kthread, so this thread is never it. | ||
121 | */ | ||
122 | static bool rcu_is_callbacks_kthread(void) | ||
123 | { | ||
124 | return false; | ||
125 | } | ||
126 | |||
127 | #endif /* #ifdef CONFIG_RCU_TRACE */ | ||
128 | |||
129 | static int __init rcu_scheduler_really_started(void) | ||
130 | { | ||
131 | rcu_scheduler_fully_active = 1; | ||
132 | open_softirq(RCU_SOFTIRQ, rcu_process_callbacks); | ||
133 | raise_softirq(RCU_SOFTIRQ); /* Invoke any callbacks from early boot. */ | ||
134 | return 0; | ||
135 | } | ||
136 | early_initcall(rcu_scheduler_really_started); | ||
137 | |||
138 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 105 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
139 | #include <linux/kernel_stat.h> | 106 | #include <linux/kernel_stat.h> |
140 | 107 | ||