Skip to content

Commit

Permalink
rcu: Add destroy_work_on_stack() to match INIT_WORK_ONSTACK()
Browse files Browse the repository at this point in the history
The synchronize_rcu_expedited() function has an INIT_WORK_ONSTACK(),
but lacks the corresponding destroy_work_on_stack().  This commit
therefore adds destroy_work_on_stack().

Reported-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Acked-by: Andrea Arcangeli <aarcange@redhat.com>
  • Loading branch information
Paul E. McKenney committed Aug 1, 2019
1 parent cdc694b commit fbad01a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kernel/rcu/tree_exp.h
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ static int rcu_print_task_exp_stall(struct rcu_node *rnp)
*/
void synchronize_rcu_expedited(void)
{
bool boottime = (rcu_scheduler_active == RCU_SCHEDULER_INIT);
struct rcu_exp_work rew;
struct rcu_node *rnp;
unsigned long s;
Expand All @@ -817,7 +818,7 @@ void synchronize_rcu_expedited(void)
return; /* Someone else did our work for us. */

/* Ensure that load happens before action based on it. */
if (unlikely(rcu_scheduler_active == RCU_SCHEDULER_INIT)) {
if (unlikely(boottime)) {
/* Direct call during scheduler init and early_initcalls(). */
rcu_exp_sel_wait_wake(s);
} else {
Expand All @@ -835,5 +836,8 @@ void synchronize_rcu_expedited(void)

/* Let the next expedited grace period start. */
mutex_unlock(&rcu_state.exp_mutex);

if (likely(!boottime))
destroy_work_on_stack(&rew.rew_work);
}
EXPORT_SYMBOL_GPL(synchronize_rcu_expedited);

0 comments on commit fbad01a

Please sign in to comment.