diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-05-10 20:12:17 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-05-11 19:10:47 -0400 |
commit | 72d5a9f7a9542f88397558c65bcfc3b115a65e34 (patch) | |
tree | e46d3ad1948de45b9641d1a8b88f88bfb3809007 /kernel | |
parent | 4376030a54860dedab9d848dfa7cc700a6025c0b (diff) |
rcu: remove all rcu head initializations, except on_stack initializations
Remove all rcu head inits. We don't care about the RCU head state before passing
it to call_rcu() anyway. Only leave the "on_stack" variants so debugobjects can
keep track of objects on stack.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rcutiny.c | 6 | ||||
-rw-r--r-- | kernel/rcutorture.c | 2 | ||||
-rw-r--r-- | kernel/rcutree.c | 4 | ||||
-rw-r--r-- | kernel/rcutree_plugin.h | 2 |
4 files changed, 14 insertions, 0 deletions
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c index b1804ff83d5e..38729d3cd236 100644 --- a/kernel/rcutiny.c +++ b/kernel/rcutiny.c | |||
@@ -245,11 +245,13 @@ void rcu_barrier(void) | |||
245 | { | 245 | { |
246 | struct rcu_synchronize rcu; | 246 | struct rcu_synchronize rcu; |
247 | 247 | ||
248 | init_rcu_head_on_stack(&rcu.head); | ||
248 | init_completion(&rcu.completion); | 249 | init_completion(&rcu.completion); |
249 | /* Will wake me after RCU finished. */ | 250 | /* Will wake me after RCU finished. */ |
250 | call_rcu(&rcu.head, wakeme_after_rcu); | 251 | call_rcu(&rcu.head, wakeme_after_rcu); |
251 | /* Wait for it. */ | 252 | /* Wait for it. */ |
252 | wait_for_completion(&rcu.completion); | 253 | wait_for_completion(&rcu.completion); |
254 | destroy_rcu_head_on_stack(&rcu.head); | ||
253 | } | 255 | } |
254 | EXPORT_SYMBOL_GPL(rcu_barrier); | 256 | EXPORT_SYMBOL_GPL(rcu_barrier); |
255 | 257 | ||
@@ -257,11 +259,13 @@ void rcu_barrier_bh(void) | |||
257 | { | 259 | { |
258 | struct rcu_synchronize rcu; | 260 | struct rcu_synchronize rcu; |
259 | 261 | ||
262 | init_rcu_head_on_stack(&rcu.head); | ||
260 | init_completion(&rcu.completion); | 263 | init_completion(&rcu.completion); |
261 | /* Will wake me after RCU finished. */ | 264 | /* Will wake me after RCU finished. */ |
262 | call_rcu_bh(&rcu.head, wakeme_after_rcu); | 265 | call_rcu_bh(&rcu.head, wakeme_after_rcu); |
263 | /* Wait for it. */ | 266 | /* Wait for it. */ |
264 | wait_for_completion(&rcu.completion); | 267 | wait_for_completion(&rcu.completion); |
268 | destroy_rcu_head_on_stack(&rcu.head); | ||
265 | } | 269 | } |
266 | EXPORT_SYMBOL_GPL(rcu_barrier_bh); | 270 | EXPORT_SYMBOL_GPL(rcu_barrier_bh); |
267 | 271 | ||
@@ -269,11 +273,13 @@ void rcu_barrier_sched(void) | |||
269 | { | 273 | { |
270 | struct rcu_synchronize rcu; | 274 | struct rcu_synchronize rcu; |
271 | 275 | ||
276 | init_rcu_head_on_stack(&rcu.head); | ||
272 | init_completion(&rcu.completion); | 277 | init_completion(&rcu.completion); |
273 | /* Will wake me after RCU finished. */ | 278 | /* Will wake me after RCU finished. */ |
274 | call_rcu_sched(&rcu.head, wakeme_after_rcu); | 279 | call_rcu_sched(&rcu.head, wakeme_after_rcu); |
275 | /* Wait for it. */ | 280 | /* Wait for it. */ |
276 | wait_for_completion(&rcu.completion); | 281 | wait_for_completion(&rcu.completion); |
282 | destroy_rcu_head_on_stack(&rcu.head); | ||
277 | } | 283 | } |
278 | EXPORT_SYMBOL_GPL(rcu_barrier_sched); | 284 | EXPORT_SYMBOL_GPL(rcu_barrier_sched); |
279 | 285 | ||
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index 58df55bf83ed..077defb34571 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c | |||
@@ -464,9 +464,11 @@ static void rcu_bh_torture_synchronize(void) | |||
464 | { | 464 | { |
465 | struct rcu_bh_torture_synchronize rcu; | 465 | struct rcu_bh_torture_synchronize rcu; |
466 | 466 | ||
467 | init_rcu_head_on_stack(&rcu.head); | ||
467 | init_completion(&rcu.completion); | 468 | init_completion(&rcu.completion); |
468 | call_rcu_bh(&rcu.head, rcu_bh_torture_wakeme_after_cb); | 469 | call_rcu_bh(&rcu.head, rcu_bh_torture_wakeme_after_cb); |
469 | wait_for_completion(&rcu.completion); | 470 | wait_for_completion(&rcu.completion); |
471 | destroy_rcu_head_on_stack(&rcu.head); | ||
470 | } | 472 | } |
471 | 473 | ||
472 | static struct rcu_torture_ops rcu_bh_ops = { | 474 | static struct rcu_torture_ops rcu_bh_ops = { |
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index ba6996943e28..d4437345706f 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -1484,11 +1484,13 @@ void synchronize_sched(void) | |||
1484 | if (rcu_blocking_is_gp()) | 1484 | if (rcu_blocking_is_gp()) |
1485 | return; | 1485 | return; |
1486 | 1486 | ||
1487 | init_rcu_head_on_stack(&rcu.head); | ||
1487 | init_completion(&rcu.completion); | 1488 | init_completion(&rcu.completion); |
1488 | /* Will wake me after RCU finished. */ | 1489 | /* Will wake me after RCU finished. */ |
1489 | call_rcu_sched(&rcu.head, wakeme_after_rcu); | 1490 | call_rcu_sched(&rcu.head, wakeme_after_rcu); |
1490 | /* Wait for it. */ | 1491 | /* Wait for it. */ |
1491 | wait_for_completion(&rcu.completion); | 1492 | wait_for_completion(&rcu.completion); |
1493 | destroy_rcu_head_on_stack(&rcu.head); | ||
1492 | } | 1494 | } |
1493 | EXPORT_SYMBOL_GPL(synchronize_sched); | 1495 | EXPORT_SYMBOL_GPL(synchronize_sched); |
1494 | 1496 | ||
@@ -1508,11 +1510,13 @@ void synchronize_rcu_bh(void) | |||
1508 | if (rcu_blocking_is_gp()) | 1510 | if (rcu_blocking_is_gp()) |
1509 | return; | 1511 | return; |
1510 | 1512 | ||
1513 | init_rcu_head_on_stack(&rcu.head); | ||
1511 | init_completion(&rcu.completion); | 1514 | init_completion(&rcu.completion); |
1512 | /* Will wake me after RCU finished. */ | 1515 | /* Will wake me after RCU finished. */ |
1513 | call_rcu_bh(&rcu.head, wakeme_after_rcu); | 1516 | call_rcu_bh(&rcu.head, wakeme_after_rcu); |
1514 | /* Wait for it. */ | 1517 | /* Wait for it. */ |
1515 | wait_for_completion(&rcu.completion); | 1518 | wait_for_completion(&rcu.completion); |
1519 | destroy_rcu_head_on_stack(&rcu.head); | ||
1516 | } | 1520 | } |
1517 | EXPORT_SYMBOL_GPL(synchronize_rcu_bh); | 1521 | EXPORT_SYMBOL_GPL(synchronize_rcu_bh); |
1518 | 1522 | ||
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index ac7d80fa895c..0e4f420245d9 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h | |||
@@ -557,11 +557,13 @@ void synchronize_rcu(void) | |||
557 | if (!rcu_scheduler_active) | 557 | if (!rcu_scheduler_active) |
558 | return; | 558 | return; |
559 | 559 | ||
560 | init_rcu_head_on_stack(&rcu.head); | ||
560 | init_completion(&rcu.completion); | 561 | init_completion(&rcu.completion); |
561 | /* Will wake me after RCU finished. */ | 562 | /* Will wake me after RCU finished. */ |
562 | call_rcu(&rcu.head, wakeme_after_rcu); | 563 | call_rcu(&rcu.head, wakeme_after_rcu); |
563 | /* Wait for it. */ | 564 | /* Wait for it. */ |
564 | wait_for_completion(&rcu.completion); | 565 | wait_for_completion(&rcu.completion); |
566 | destroy_rcu_head_on_stack(&rcu.head); | ||
565 | } | 567 | } |
566 | EXPORT_SYMBOL_GPL(synchronize_rcu); | 568 | EXPORT_SYMBOL_GPL(synchronize_rcu); |
567 | 569 | ||