diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-09-29 08:15:52 -0700 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-12-04 12:26:50 -0800 |
commit | 06f60de19d3141f07d954c9275fe7ccca8e96b42 (patch) | |
tree | d0521b8b3c3d665bdba8d5854d4b598faa4b96db /kernel/rcu | |
parent | 6cf10081220ae21175a867d446b3167bcbcb937b (diff) | |
download | blackbird-op-linux-06f60de19d3141f07d954c9275fe7ccca8e96b42.tar.gz blackbird-op-linux-06f60de19d3141f07d954c9275fe7ccca8e96b42.zip |
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>
Diffstat (limited to 'kernel/rcu')
-rw-r--r-- | kernel/rcu/tree.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 81aa1cdc6bc9..bd2605c144cc 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -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); |