aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2012-06-11 20:39:43 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-09-23 10:41:53 -0400
commitb626c1b689364859ccd2e86d5e043aeadfeb2cd4 (patch)
tree6a9deb7bd94a1bcf30b60ca0eb8c1d5f3a2b9172 /kernel/rcutree.h
parentbfa00b4c4028f39357d16279ff0fddf550241593 (diff)
rcu: Provide OOM handler to motivate lazy RCU callbacks
In kernels built with CONFIG_RCU_FAST_NO_HZ=y, CPUs can accumulate a large number of lazy callbacks, which as the name implies will be slow to be invoked. This can be a problem on small-memory systems, where the default 6-second sleep for CPUs having only lazy RCU callbacks could well be fatal. This commit therefore installs an OOM hander that ensures that every CPU with lazy callbacks has at least one non-lazy callback, in turn ensuring timely advancement for these callbacks. Updated to fix bug that disabled OOM killing, noted by Lai Jiangshan. Updated to push the for_each_rcu_flavor() loop into rcu_oom_notify_cpu(), thus reducing the number of IPIs, as suggested by Steven Rostedt. Also to make the for_each_online_cpu() loop be preemptible. (Later, it might be good to use smp_call_function(), as suggested by Peter Zijlstra.) Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Tested-by: Sasha Levin <levinsasha928@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree.h')
-rw-r--r--kernel/rcutree.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/rcutree.h b/kernel/rcutree.h
index 117a15019e99..effb2733b7fc 100644
--- a/kernel/rcutree.h
+++ b/kernel/rcutree.h
@@ -315,8 +315,11 @@ struct rcu_data {
315 unsigned long n_rp_need_fqs; 315 unsigned long n_rp_need_fqs;
316 unsigned long n_rp_need_nothing; 316 unsigned long n_rp_need_nothing;
317 317
318 /* 6) _rcu_barrier() callback. */ 318 /* 6) _rcu_barrier() and OOM callbacks. */
319 struct rcu_head barrier_head; 319 struct rcu_head barrier_head;
320#ifdef CONFIG_RCU_FAST_NO_HZ
321 struct rcu_head oom_head;
322#endif /* #ifdef CONFIG_RCU_FAST_NO_HZ */
320 323
321 int cpu; 324 int cpu;
322 struct rcu_state *rsp; 325 struct rcu_state *rsp;