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

Commit 06f60de1 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcu: Short-circuit synchronize_sched_expedited() if only one CPU



If there is only one CPU, then invoking synchronize_sched_expedited()
is by definition a grace period.  This commit checks for this condition
and does a short-circuit return in that case.

Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 6cf10081
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3822,6 +3822,10 @@ void synchronize_sched_expedited(void)
	struct rcu_node *rnp;
	struct rcu_state *rsp = &rcu_sched_state;

	/* If only one CPU, this is automatically a grace period. */
	if (rcu_blocking_is_gp())
		return;

	/* Take a snapshot of the sequence number.  */
	s = rcu_exp_gp_seq_snap(rsp);