aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree_plugin.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-11-18 00:08:07 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-17 19:03:33 -0500
commitf1f399d1281ea339a08469f7e58193624992f620 (patch)
tree915284120382e3180c3e58ba157cf045998549d0 /kernel/rcu/tree_plugin.h
parentffa83fb565fbc397cbafb4b71fd1cce276d4c3b6 (diff)
rcu: Optimize RCU_FAST_NO_HZ for RCU_NOCB_CPU_ALL
If CONFIG_RCU_NOCB_CPU_ALL=y, then no CPU will ever have RCU callbacks because these callbacks will instead be handled by the rcuo kthreads. However, the current version of RCU_FAST_NO_HZ nevertheless checks for RCU callbacks. This commit therefore creates static inline implementations of rcu_prepare_for_idle() and rcu_cleanup_after_idle() that are no-ops when CONFIG_RCU_NOCB_CPU_ALL=y. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcu/tree_plugin.h')
-rw-r--r--kernel/rcu/tree_plugin.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 820b06aefbee..41afc3fbfb6c 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1658,7 +1658,7 @@ extern int tick_nohz_active;
1658 * only if it has been awhile since the last time we did so. Afterwards, 1658 * only if it has been awhile since the last time we did so. Afterwards,
1659 * if there are any callbacks ready for immediate invocation, return true. 1659 * if there are any callbacks ready for immediate invocation, return true.
1660 */ 1660 */
1661static bool rcu_try_advance_all_cbs(void) 1661static bool __maybe_unused rcu_try_advance_all_cbs(void)
1662{ 1662{
1663 bool cbs_ready = false; 1663 bool cbs_ready = false;
1664 struct rcu_data *rdp; 1664 struct rcu_data *rdp;
@@ -1743,6 +1743,7 @@ int rcu_needs_cpu(int cpu, unsigned long *dj)
1743 */ 1743 */
1744static void rcu_prepare_for_idle(int cpu) 1744static void rcu_prepare_for_idle(int cpu)
1745{ 1745{
1746#ifndef CONFIG_RCU_NOCB_CPU_ALL
1746 struct rcu_data *rdp; 1747 struct rcu_data *rdp;
1747 struct rcu_dynticks *rdtp = &per_cpu(rcu_dynticks, cpu); 1748 struct rcu_dynticks *rdtp = &per_cpu(rcu_dynticks, cpu);
1748 struct rcu_node *rnp; 1749 struct rcu_node *rnp;
@@ -1794,6 +1795,7 @@ static void rcu_prepare_for_idle(int cpu)
1794 rcu_accelerate_cbs(rsp, rnp, rdp); 1795 rcu_accelerate_cbs(rsp, rnp, rdp);
1795 raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ 1796 raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */
1796 } 1797 }
1798#endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */
1797} 1799}
1798 1800
1799/* 1801/*
@@ -1803,11 +1805,12 @@ static void rcu_prepare_for_idle(int cpu)
1803 */ 1805 */
1804static void rcu_cleanup_after_idle(int cpu) 1806static void rcu_cleanup_after_idle(int cpu)
1805{ 1807{
1806 1808#ifndef CONFIG_RCU_NOCB_CPU_ALL
1807 if (rcu_is_nocb_cpu(cpu)) 1809 if (rcu_is_nocb_cpu(cpu))
1808 return; 1810 return;
1809 if (rcu_try_advance_all_cbs()) 1811 if (rcu_try_advance_all_cbs())
1810 invoke_rcu_core(); 1812 invoke_rcu_core();
1813#endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */
1811} 1814}
1812 1815
1813/* 1816/*