Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a497c96 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcu: Remove redundant code from rcu_cleanup_after_idle()



The rcu_try_advance_all_cbs() function returns a bool saying whether or
not there are callbacks ready to invoke, but rcu_cleanup_after_idle()
rechecks this regardless.  This commit therefore uses the value returned
by rcu_try_advance_all_cbs() instead of making rcu_cleanup_after_idle()
do this recheck.

Reported-by: default avatarTibor Billes <tbilles@gmx.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: default avatarTibor Billes <tbilles@gmx.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
parent 272b98c6
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -1768,18 +1768,12 @@ static void rcu_prepare_for_idle(int cpu)
 */
static void rcu_cleanup_after_idle(int cpu)
{
	struct rcu_data *rdp;
	struct rcu_state *rsp;

	if (rcu_is_nocb_cpu(cpu))
		return;
	rcu_try_advance_all_cbs();
	for_each_rcu_flavor(rsp) {
		rdp = per_cpu_ptr(rsp->rda, cpu);
		if (cpu_has_callbacks_ready_to_invoke(rdp))
	if (rcu_try_advance_all_cbs())
		invoke_rcu_core();
}
}

/*
 * Keep a running count of the number of non-lazy callbacks posted