summaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-03-04 18:41:24 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-05-27 15:58:00 -0400
commit3382adbc1bb8c80ea512243acf6059564287620b (patch)
treed9244774e5c051c68ebd5409bf55e7f23296ee53 /kernel/rcu
parent2927a689e8ad5c12d6300b41e873d2b7957bc0e1 (diff)
rcu: Eliminate a few CONFIG_RCU_NOCB_CPU_ALL #ifdefs
This commit converts several CONFIG_RCU_NOCB_CPU_ALL #ifdefs to instead use IS_ENABLED(). This change should help avoid hiding code from compiler diagnostics. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/tree_plugin.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 5c0122f09ed0..0730bfcf65db 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1372,13 +1372,12 @@ static void rcu_prepare_kthreads(int cpu)
1372 * Because we not have RCU_FAST_NO_HZ, just check whether this CPU needs 1372 * Because we not have RCU_FAST_NO_HZ, just check whether this CPU needs
1373 * any flavor of RCU. 1373 * any flavor of RCU.
1374 */ 1374 */
1375#ifndef CONFIG_RCU_NOCB_CPU_ALL
1376int rcu_needs_cpu(unsigned long *delta_jiffies) 1375int rcu_needs_cpu(unsigned long *delta_jiffies)
1377{ 1376{
1378 *delta_jiffies = ULONG_MAX; 1377 *delta_jiffies = ULONG_MAX;
1379 return rcu_cpu_has_callbacks(NULL); 1378 return IS_ENABLED(CONFIG_RCU_NOCB_CPU_ALL)
1379 ? 0 : rcu_cpu_has_callbacks(NULL);
1380} 1380}
1381#endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */
1382 1381
1383/* 1382/*
1384 * Because we do not have RCU_FAST_NO_HZ, don't bother cleaning up 1383 * Because we do not have RCU_FAST_NO_HZ, don't bother cleaning up
@@ -1485,11 +1484,15 @@ static bool __maybe_unused rcu_try_advance_all_cbs(void)
1485 * 1484 *
1486 * The caller must have disabled interrupts. 1485 * The caller must have disabled interrupts.
1487 */ 1486 */
1488#ifndef CONFIG_RCU_NOCB_CPU_ALL
1489int rcu_needs_cpu(unsigned long *dj) 1487int rcu_needs_cpu(unsigned long *dj)
1490{ 1488{
1491 struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks); 1489 struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
1492 1490
1491 if (IS_ENABLED(CONFIG_RCU_NOCB_CPU_ALL)) {
1492 *dj = ULONG_MAX;
1493 return 0;
1494 }
1495
1493 /* Snapshot to detect later posting of non-lazy callback. */ 1496 /* Snapshot to detect later posting of non-lazy callback. */
1494 rdtp->nonlazy_posted_snap = rdtp->nonlazy_posted; 1497 rdtp->nonlazy_posted_snap = rdtp->nonlazy_posted;
1495 1498
@@ -1516,7 +1519,6 @@ int rcu_needs_cpu(unsigned long *dj)
1516 } 1519 }
1517 return 0; 1520 return 0;
1518} 1521}
1519#endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */
1520 1522
1521/* 1523/*
1522 * Prepare a CPU for idle from an RCU perspective. The first major task 1524 * Prepare a CPU for idle from an RCU perspective. The first major task
@@ -1530,7 +1532,6 @@ int rcu_needs_cpu(unsigned long *dj)
1530 */ 1532 */
1531static void rcu_prepare_for_idle(void) 1533static void rcu_prepare_for_idle(void)
1532{ 1534{
1533#ifndef CONFIG_RCU_NOCB_CPU_ALL
1534 bool needwake; 1535 bool needwake;
1535 struct rcu_data *rdp; 1536 struct rcu_data *rdp;
1536 struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks); 1537 struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
@@ -1538,6 +1539,9 @@ static void rcu_prepare_for_idle(void)
1538 struct rcu_state *rsp; 1539 struct rcu_state *rsp;
1539 int tne; 1540 int tne;
1540 1541
1542 if (IS_ENABLED(CONFIG_RCU_NOCB_CPU_ALL))
1543 return;
1544
1541 /* Handle nohz enablement switches conservatively. */ 1545 /* Handle nohz enablement switches conservatively. */
1542 tne = READ_ONCE(tick_nohz_active); 1546 tne = READ_ONCE(tick_nohz_active);
1543 if (tne != rdtp->tick_nohz_enabled_snap) { 1547 if (tne != rdtp->tick_nohz_enabled_snap) {
@@ -1585,7 +1589,6 @@ static void rcu_prepare_for_idle(void)
1585 if (needwake) 1589 if (needwake)
1586 rcu_gp_kthread_wake(rsp); 1590 rcu_gp_kthread_wake(rsp);
1587 } 1591 }
1588#endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */
1589} 1592}
1590 1593
1591/* 1594/*
@@ -1595,12 +1598,11 @@ static void rcu_prepare_for_idle(void)
1595 */ 1598 */
1596static void rcu_cleanup_after_idle(void) 1599static void rcu_cleanup_after_idle(void)
1597{ 1600{
1598#ifndef CONFIG_RCU_NOCB_CPU_ALL 1601 if (IS_ENABLED(CONFIG_RCU_NOCB_CPU_ALL) ||
1599 if (rcu_is_nocb_cpu(smp_processor_id())) 1602 rcu_is_nocb_cpu(smp_processor_id()))
1600 return; 1603 return;
1601 if (rcu_try_advance_all_cbs()) 1604 if (rcu_try_advance_all_cbs())
1602 invoke_rcu_core(); 1605 invoke_rcu_core();
1603#endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */
1604} 1606}
1605 1607
1606/* 1608/*