diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-03-19 15:21:29 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-06-10 16:39:44 -0400 |
commit | 63274cfb94aac109fc2490a70a96b26751608e57 (patch) | |
tree | 9e14753b46b04098ebd08607246a21cedd5dd235 /kernel/rcutree.c | |
parent | ba9fbe955f026780e6b27c279dba7c86dfdcb7d5 (diff) |
rcu: Eliminate check_for_new_grace_period() wrapper function
One of the calls to check_for_new_grace_period() is now redundant due to
an immediately preceding call to note_gp_changes(). Eliminating this
redundant call leaves a single caller, which is simpler if inlined.
This commit therefore eliminates the redundant call and inlines the
body of check_for_new_grace_period() into the single remaining call site.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r-- | kernel/rcutree.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index ac8f03c41476..b73014998b40 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -1308,26 +1308,6 @@ static void note_gp_changes(struct rcu_state *rsp, struct rcu_data *rdp) | |||
1308 | } | 1308 | } |
1309 | 1309 | ||
1310 | /* | 1310 | /* |
1311 | * Did someone else start a new RCU grace period start since we last | ||
1312 | * checked? Update local state appropriately if so. Must be called | ||
1313 | * on the CPU corresponding to rdp. | ||
1314 | */ | ||
1315 | static int | ||
1316 | check_for_new_grace_period(struct rcu_state *rsp, struct rcu_data *rdp) | ||
1317 | { | ||
1318 | unsigned long flags; | ||
1319 | int ret = 0; | ||
1320 | |||
1321 | local_irq_save(flags); | ||
1322 | if (rdp->gpnum != rsp->gpnum) { | ||
1323 | note_gp_changes(rsp, rdp); | ||
1324 | ret = 1; | ||
1325 | } | ||
1326 | local_irq_restore(flags); | ||
1327 | return ret; | ||
1328 | } | ||
1329 | |||
1330 | /* | ||
1331 | * Do per-CPU grace-period initialization for running CPU. The caller | 1311 | * Do per-CPU grace-period initialization for running CPU. The caller |
1332 | * must hold the lock of the leaf rcu_node structure corresponding to | 1312 | * must hold the lock of the leaf rcu_node structure corresponding to |
1333 | * this CPU. | 1313 | * this CPU. |
@@ -1749,8 +1729,10 @@ static void | |||
1749 | rcu_check_quiescent_state(struct rcu_state *rsp, struct rcu_data *rdp) | 1729 | rcu_check_quiescent_state(struct rcu_state *rsp, struct rcu_data *rdp) |
1750 | { | 1730 | { |
1751 | /* If there is now a new grace period, record and return. */ | 1731 | /* If there is now a new grace period, record and return. */ |
1752 | if (check_for_new_grace_period(rsp, rdp)) | 1732 | if (rdp->gpnum != rsp->gpnum) { |
1733 | note_gp_changes(rsp, rdp); | ||
1753 | return; | 1734 | return; |
1735 | } | ||
1754 | 1736 | ||
1755 | /* | 1737 | /* |
1756 | * Does this CPU still need to do its part for current grace period? | 1738 | * Does this CPU still need to do its part for current grace period? |
@@ -2302,7 +2284,6 @@ static void __call_rcu_core(struct rcu_state *rsp, struct rcu_data *rdp, | |||
2302 | 2284 | ||
2303 | /* Are we ignoring a completed grace period? */ | 2285 | /* Are we ignoring a completed grace period? */ |
2304 | note_gp_changes(rsp, rdp); | 2286 | note_gp_changes(rsp, rdp); |
2305 | check_for_new_grace_period(rsp, rdp); | ||
2306 | 2287 | ||
2307 | /* Start a new grace period if one not already started. */ | 2288 | /* Start a new grace period if one not already started. */ |
2308 | if (!rcu_gp_in_progress(rsp)) { | 2289 | if (!rcu_gp_in_progress(rsp)) { |