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>
This commit is contained in:
Родитель
4376030a54
Коммит
72d5a9f7a9
|
@ -49,7 +49,6 @@ extern struct group_info init_groups;
|
||||||
{ .first = &init_task.pids[PIDTYPE_PGID].node }, \
|
{ .first = &init_task.pids[PIDTYPE_PGID].node }, \
|
||||||
{ .first = &init_task.pids[PIDTYPE_SID].node }, \
|
{ .first = &init_task.pids[PIDTYPE_SID].node }, \
|
||||||
}, \
|
}, \
|
||||||
.rcu = RCU_HEAD_INIT, \
|
|
||||||
.level = 0, \
|
.level = 0, \
|
||||||
.numbers = { { \
|
.numbers = { { \
|
||||||
.nr = 0, \
|
.nr = 0, \
|
||||||
|
|
|
@ -245,11 +245,13 @@ void rcu_barrier(void)
|
||||||
{
|
{
|
||||||
struct rcu_synchronize rcu;
|
struct rcu_synchronize rcu;
|
||||||
|
|
||||||
|
init_rcu_head_on_stack(&rcu.head);
|
||||||
init_completion(&rcu.completion);
|
init_completion(&rcu.completion);
|
||||||
/* Will wake me after RCU finished. */
|
/* Will wake me after RCU finished. */
|
||||||
call_rcu(&rcu.head, wakeme_after_rcu);
|
call_rcu(&rcu.head, wakeme_after_rcu);
|
||||||
/* Wait for it. */
|
/* Wait for it. */
|
||||||
wait_for_completion(&rcu.completion);
|
wait_for_completion(&rcu.completion);
|
||||||
|
destroy_rcu_head_on_stack(&rcu.head);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(rcu_barrier);
|
EXPORT_SYMBOL_GPL(rcu_barrier);
|
||||||
|
|
||||||
|
@ -257,11 +259,13 @@ void rcu_barrier_bh(void)
|
||||||
{
|
{
|
||||||
struct rcu_synchronize rcu;
|
struct rcu_synchronize rcu;
|
||||||
|
|
||||||
|
init_rcu_head_on_stack(&rcu.head);
|
||||||
init_completion(&rcu.completion);
|
init_completion(&rcu.completion);
|
||||||
/* Will wake me after RCU finished. */
|
/* Will wake me after RCU finished. */
|
||||||
call_rcu_bh(&rcu.head, wakeme_after_rcu);
|
call_rcu_bh(&rcu.head, wakeme_after_rcu);
|
||||||
/* Wait for it. */
|
/* Wait for it. */
|
||||||
wait_for_completion(&rcu.completion);
|
wait_for_completion(&rcu.completion);
|
||||||
|
destroy_rcu_head_on_stack(&rcu.head);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(rcu_barrier_bh);
|
EXPORT_SYMBOL_GPL(rcu_barrier_bh);
|
||||||
|
|
||||||
|
@ -269,11 +273,13 @@ void rcu_barrier_sched(void)
|
||||||
{
|
{
|
||||||
struct rcu_synchronize rcu;
|
struct rcu_synchronize rcu;
|
||||||
|
|
||||||
|
init_rcu_head_on_stack(&rcu.head);
|
||||||
init_completion(&rcu.completion);
|
init_completion(&rcu.completion);
|
||||||
/* Will wake me after RCU finished. */
|
/* Will wake me after RCU finished. */
|
||||||
call_rcu_sched(&rcu.head, wakeme_after_rcu);
|
call_rcu_sched(&rcu.head, wakeme_after_rcu);
|
||||||
/* Wait for it. */
|
/* Wait for it. */
|
||||||
wait_for_completion(&rcu.completion);
|
wait_for_completion(&rcu.completion);
|
||||||
|
destroy_rcu_head_on_stack(&rcu.head);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(rcu_barrier_sched);
|
EXPORT_SYMBOL_GPL(rcu_barrier_sched);
|
||||||
|
|
||||||
|
|
|
@ -464,9 +464,11 @@ static void rcu_bh_torture_synchronize(void)
|
||||||
{
|
{
|
||||||
struct rcu_bh_torture_synchronize rcu;
|
struct rcu_bh_torture_synchronize rcu;
|
||||||
|
|
||||||
|
init_rcu_head_on_stack(&rcu.head);
|
||||||
init_completion(&rcu.completion);
|
init_completion(&rcu.completion);
|
||||||
call_rcu_bh(&rcu.head, rcu_bh_torture_wakeme_after_cb);
|
call_rcu_bh(&rcu.head, rcu_bh_torture_wakeme_after_cb);
|
||||||
wait_for_completion(&rcu.completion);
|
wait_for_completion(&rcu.completion);
|
||||||
|
destroy_rcu_head_on_stack(&rcu.head);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct rcu_torture_ops rcu_bh_ops = {
|
static struct rcu_torture_ops rcu_bh_ops = {
|
||||||
|
|
|
@ -1484,11 +1484,13 @@ void synchronize_sched(void)
|
||||||
if (rcu_blocking_is_gp())
|
if (rcu_blocking_is_gp())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
init_rcu_head_on_stack(&rcu.head);
|
||||||
init_completion(&rcu.completion);
|
init_completion(&rcu.completion);
|
||||||
/* Will wake me after RCU finished. */
|
/* Will wake me after RCU finished. */
|
||||||
call_rcu_sched(&rcu.head, wakeme_after_rcu);
|
call_rcu_sched(&rcu.head, wakeme_after_rcu);
|
||||||
/* Wait for it. */
|
/* Wait for it. */
|
||||||
wait_for_completion(&rcu.completion);
|
wait_for_completion(&rcu.completion);
|
||||||
|
destroy_rcu_head_on_stack(&rcu.head);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(synchronize_sched);
|
EXPORT_SYMBOL_GPL(synchronize_sched);
|
||||||
|
|
||||||
|
@ -1508,11 +1510,13 @@ void synchronize_rcu_bh(void)
|
||||||
if (rcu_blocking_is_gp())
|
if (rcu_blocking_is_gp())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
init_rcu_head_on_stack(&rcu.head);
|
||||||
init_completion(&rcu.completion);
|
init_completion(&rcu.completion);
|
||||||
/* Will wake me after RCU finished. */
|
/* Will wake me after RCU finished. */
|
||||||
call_rcu_bh(&rcu.head, wakeme_after_rcu);
|
call_rcu_bh(&rcu.head, wakeme_after_rcu);
|
||||||
/* Wait for it. */
|
/* Wait for it. */
|
||||||
wait_for_completion(&rcu.completion);
|
wait_for_completion(&rcu.completion);
|
||||||
|
destroy_rcu_head_on_stack(&rcu.head);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(synchronize_rcu_bh);
|
EXPORT_SYMBOL_GPL(synchronize_rcu_bh);
|
||||||
|
|
||||||
|
|
|
@ -557,11 +557,13 @@ void synchronize_rcu(void)
|
||||||
if (!rcu_scheduler_active)
|
if (!rcu_scheduler_active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
init_rcu_head_on_stack(&rcu.head);
|
||||||
init_completion(&rcu.completion);
|
init_completion(&rcu.completion);
|
||||||
/* Will wake me after RCU finished. */
|
/* Will wake me after RCU finished. */
|
||||||
call_rcu(&rcu.head, wakeme_after_rcu);
|
call_rcu(&rcu.head, wakeme_after_rcu);
|
||||||
/* Wait for it. */
|
/* Wait for it. */
|
||||||
wait_for_completion(&rcu.completion);
|
wait_for_completion(&rcu.completion);
|
||||||
|
destroy_rcu_head_on_stack(&rcu.head);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(synchronize_rcu);
|
EXPORT_SYMBOL_GPL(synchronize_rcu);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче