Commit ac631f75 authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Jiri Slaby

rcu: Throttle invoke_rcu_core() invocations due to non-lazy callbacks

commit c337f8f5 upstream.

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: default avatarTibor Billes <tbilles@gmx.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: default avatarTibor Billes <tbilles@gmx.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent d30b39cb
...@@ -1739,6 +1739,8 @@ static void rcu_prepare_for_idle(int cpu) ...@@ -1739,6 +1739,8 @@ static void rcu_prepare_for_idle(int cpu)
*/ */
if (rdtp->all_lazy && if (rdtp->all_lazy &&
rdtp->nonlazy_posted != rdtp->nonlazy_posted_snap) { rdtp->nonlazy_posted != rdtp->nonlazy_posted_snap) {
rdtp->all_lazy = false;
rdtp->nonlazy_posted_snap = rdtp->nonlazy_posted;
invoke_rcu_core(); invoke_rcu_core();
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment