aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-09-05 20:02:11 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-09-25 09:44:33 -0400
commitc337f8f58ed7cf150651d232af8222421a71463d (patch)
treed439faf0c005efc4e038477696dd15878efa5cb4
parentc229828ca6bc62d6c654f64b1d1b8a9ebd8a56f3 (diff)
rcu: Throttle invoke_rcu_core() invocations due to non-lazy callbacks
If a non-lazy callback arrives on a CPU that has previously gone idle with no non-lazy callbacks, invoke_rcu_core() forces the RCU core to run. However, it does not update the conditions, which could result in several closely spaced invocations of the RCU core, which in turn could result in an excessively high context-switch rate and resulting high overhead. This commit therefore updates the ->all_lazy and ->nonlazy_posted_snap fields to prevent closely spaced invocations. Reported-by: Tibor Billes <tbilles@gmx.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Tested-by: Tibor Billes <tbilles@gmx.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
-rw-r--r--kernel/rcutree_plugin.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index d81e3856fa91..2c15d7c10684 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -1745,6 +1745,8 @@ static void rcu_prepare_for_idle(int cpu)
1745 */ 1745 */
1746 if (rdtp->all_lazy && 1746 if (rdtp->all_lazy &&
1747 rdtp->nonlazy_posted != rdtp->nonlazy_posted_snap) { 1747 rdtp->nonlazy_posted != rdtp->nonlazy_posted_snap) {
1748 rdtp->all_lazy = false;
1749 rdtp->nonlazy_posted_snap = rdtp->nonlazy_posted;
1748 invoke_rcu_core(); 1750 invoke_rcu_core();
1749 return; 1751 return;
1750 } 1752 }