]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - Documentation/admin-guide/kernel-parameters.txt
srcu: Prevent sdp->srcu_gp_seq_needed counter wrap
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 3 May 2017 22:35:32 +0000 (15:35 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 9 Jun 2017 01:52:34 +0000 (18:52 -0700)
commitc350c008297643dad3c395c2fd92230142da5cf6
tree731bff2816d661ee0c1015a6e5e4423ccfd87f7f
parent71c40fd0b5ceb300c6cb8753835d9d94a8bfc56f
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>
Documentation/admin-guide/kernel-parameters.txt
kernel/rcu/srcutree.c