| From 4716efb430f63904952748c39ebe8696cb850f72 Mon Sep 17 00:00:00 2001 |
| From: "Paul E. McKenney" <paulmck@linux.ibm.com> |
| Date: Fri, 5 Jul 2019 08:05:10 -0700 |
| Subject: [PATCH] rcu: Remove redundant "if" condition from |
| rcu_gp_is_expedited() |
| |
| commit b823cafa7501f946a37dce5aa1e576a0b2f31ed9 upstream. |
| |
| Because rcu_expedited_nesting is initialized to 1 and not decremented |
| until just before init is spawned, rcu_expedited_nesting is guaranteed |
| to be non-zero whenever rcu_scheduler_active == RCU_SCHEDULER_INIT. |
| This commit therefore removes this redundant "if" equality test. |
| |
| Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> |
| Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c |
| index bb961cd89e76..ddb4970ad59f 100644 |
| --- a/kernel/rcu/update.c |
| +++ b/kernel/rcu/update.c |
| @@ -132,8 +132,7 @@ static atomic_t rcu_expedited_nesting = ATOMIC_INIT(1); |
| */ |
| bool rcu_gp_is_expedited(void) |
| { |
| - return rcu_expedited || atomic_read(&rcu_expedited_nesting) || |
| - rcu_scheduler_active == RCU_SCHEDULER_INIT; |
| + return rcu_expedited || atomic_read(&rcu_expedited_nesting); |
| } |
| EXPORT_SYMBOL_GPL(rcu_gp_is_expedited); |
| |
| -- |
| 2.7.4 |
| |