Commit 921bb5fa authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcu/nocb: Use build-time no-CBs check in rcu_pending()



Currently, rcu_pending() invokes rcu_segcblist_is_offloaded() even
in CONFIG_RCU_NOCB_CPU=n kernels, which cannot possibly be offloaded.
Given that rcu_pending() is on a fastpath, it makes sense to check for
CONFIG_RCU_NOCB_CPU=y before invoking rcu_segcblist_is_offloaded().
This commit therefore makes this change.

Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
parent c1ab99d6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2773,7 +2773,8 @@ static int rcu_pending(void)
	/* Has RCU gone idle with this CPU needing another grace period? */
	if (!rcu_gp_in_progress() &&
	    rcu_segcblist_is_enabled(&rdp->cblist) &&
	    !rcu_segcblist_is_offloaded(&rdp->cblist) &&
	    (!IS_ENABLED(CONFIG_RCU_NOCB_CPU) ||
	     !rcu_segcblist_is_offloaded(&rdp->cblist)) &&
	    !rcu_segcblist_restempty(&rdp->cblist, RCU_NEXT_READY_TAIL))
		return 1;