2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 11:44:01 +08:00

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: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
This commit is contained in:
Paul E. McKenney 2015-09-29 08:15:52 -07:00
parent 6cf1008122
commit 06f60de19d

View File

@ -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);