1
0
Fork 0
remarkable-linux/kernel/rcu
Paul E. McKenney c350c00829 srcu: Prevent sdp->srcu_gp_seq_needed counter wrap
If a given CPU never happens to ever start an SRCU grace period, the
grace-period sequence counter might wrap.  If this CPU were to decide to
finally start a grace period, the state of its sdp->srcu_gp_seq_needed
might make it appear that it has already requested this grace period,
which would prevent starting the grace period.  If no other CPU ever started
a grace period again, this would look like a grace-period hang.  Even
if some other CPU took pity and started the needed grace period, the
leaf rcu_node structure's ->srcu_data_have_cbs field won't have record
of the fact that this CPU has a callback pending, which would look like
a very localized grace-period hang.

This might seem very unlikely, but SRCU grace periods can take less than
a microsecond on small systems, which means that overflow can happen
in much less than an hour on a 32-bit embedded system.  And embedded
systems are especially likely to have long-term idle CPUs.  Therefore,
it makes sense to prevent this scenario from happening.

This commit therefore scans each srcu_data structure occasionally,
with frequency controlled by the srcutree.counter_wrap_check kernel
boot parameter.  This parameter can be set to something like 255
in order to exercise the counter-wrap-prevention code.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-06-08 18:52:34 -07:00
..
Makefile rcu: Separately compile large rcu_segcblist functions 2017-05-02 07:21:02 -07:00
rcu.h rcu: Move rcu_request_urgent_qs_task() out of rcutiny.h and rcutree.h 2017-06-08 18:52:33 -07:00
rcu_segcblist.c rcu: Separately compile large rcu_segcblist functions 2017-05-02 07:21:02 -07:00
rcu_segcblist.h rcu: Open-code the rcu_cblist_n_lazy_cbs() function 2017-05-02 09:22:48 -07:00
rcuperf.c rcu: Move expediting-related access/control out of rcupdate.h 2017-06-08 18:52:28 -07:00
rcutorture.c rcu: Move expediting-related access/control out of rcupdate.h 2017-06-08 18:52:28 -07:00
srcu.c srcu: Make Classic and Tree SRCU announce themselves at bootup 2017-06-08 08:25:30 -07:00
srcutiny.c srcu: Shrink Tiny SRCU a bit 2017-06-08 08:25:38 -07:00
srcutree.c srcu: Prevent sdp->srcu_gp_seq_needed counter wrap 2017-06-08 18:52:34 -07:00
sync.c locking, rcu, cgroup: Avoid synchronize_sched() in __cgroup_procs_write() 2016-08-18 15:36:59 +02:00
tiny.c rcu: Eliminate the unused __rcu_is_watching() function 2017-06-08 18:52:30 -07:00
tiny_plugin.h srcu: Allow SRCU to access rcu_scheduler_active 2017-04-18 11:38:18 -07:00
tree.c rcu: Improve __call_rcu() debug-objects error message 2017-06-08 18:52:31 -07:00
tree.h rcu: Use RCU_NOCB_WAKE rather than RCU_NOGP_WAKE 2017-06-08 08:25:40 -07:00
tree_exp.h rcu: Make sync_rcu_preempt_exp_done() return bool 2017-06-08 08:25:27 -07:00
tree_plugin.h rcu: Move docbook comments out of rcupdate.h 2017-06-08 18:52:27 -07:00
tree_trace.c rcu: Open-code the rcu_cblist_n_lazy_cbs() function 2017-05-02 09:22:48 -07:00
update.c rcu: Move rcu_expedited and rcu_normal externs from rcupdate.h 2017-06-08 18:52:27 -07:00