FROMLIST: rcu: Don't deboost before reporting expedited quiescent state
Currently rcu_preempt_deferred_qs_irqrestore() releases rnp->boost_mtx before reporting the expedited quiescent state. Under heavy real-time load, this can result in this function being preempted before the quiescent state is reported, which can in turn prevent the expedited grace period from completing. Tim Murray reports that the resulting expedited grace periods can take hundreds of milliseconds and even more than one second, when they should normally complete in less than a millisecond. This patch follows Neeraj's suggestion (seconded by Tim and by Uladzislau Rezki) of simply reversing the two operations. Reported-by: Tim Murray <timmurray@google.com> Reported-by: Joel Fernandes <joelaf@google.com> Reported-by: Neeraj Upadhyay <quic_neeraju@quicinc.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Bug: 217236054 Link: https://lore.kernel.org/lkml/20220204232406.814-9-paulmck@kernel.org/ Signed-off-by: Tim Murray <timmurray@google.com> Change-Id: Ic0f0330b65a0c776a563e03e4b59bf4ab4fbccf6
This commit is contained in:

committed by
Todd Kjos

parent
3a49d3b677
commit
c34fa06f4b
@@ -531,16 +531,16 @@ rcu_preempt_deferred_qs_irqrestore(struct task_struct *t, unsigned long flags)
|
|||||||
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
|
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unboost if we were boosted. */
|
|
||||||
if (IS_ENABLED(CONFIG_RCU_BOOST) && drop_boost_mutex)
|
|
||||||
rt_mutex_futex_unlock(&rnp->boost_mtx);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this was the last task on the expedited lists,
|
* If this was the last task on the expedited lists,
|
||||||
* then we need to report up the rcu_node hierarchy.
|
* then we need to report up the rcu_node hierarchy.
|
||||||
*/
|
*/
|
||||||
if (!empty_exp && empty_exp_now)
|
if (!empty_exp && empty_exp_now)
|
||||||
rcu_report_exp_rnp(rnp, true);
|
rcu_report_exp_rnp(rnp, true);
|
||||||
|
|
||||||
|
/* Unboost if we were boosted. */
|
||||||
|
if (IS_ENABLED(CONFIG_RCU_BOOST) && drop_boost_mutex)
|
||||||
|
rt_mutex_futex_unlock(&rnp->boost_mtx);
|
||||||
} else {
|
} else {
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user