]> git.baikalelectronics.ru Git - kernel.git/commit
rcu: Add rnp->cbovldmask check in rcutree_migrate_callbacks()
authorZqiang <qiang1.zhang@intel.com>
Thu, 5 May 2022 15:52:36 +0000 (23:52 +0800)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 19 Jul 2022 18:39:59 +0000 (11:39 -0700)
commit7ce5a20280fbf88ad19181bf87a46633b977872c
treecc09c2623c804ccfd83eba45c362b83e2834b123
parent2346a7f8c051939c179b5324839705974dc3d54b
rcu: Add rnp->cbovldmask check in rcutree_migrate_callbacks()

Currently, the rcu_node structure's ->cbovlmask field is set in call_rcu()
when a given CPU is suffering from callback overload.  But if that CPU
goes offline, the outgoing CPU's callbacks is migrated to the running
CPU, which is likely to overload the running CPU.  However, that CPU's
bit in its leaf rcu_node structure's ->cbovlmask field remains zero.

Initially, this is OK because the outgoing CPU's bit remains set.
However, that bit will be cleared at the next end of a grace period,
at which time it is quite possible that the running CPU will still
be overloaded.  If the running CPU invokes call_rcu(), then overload
will be checked for and the bit will be set.  Except that there is no
guarantee that the running CPU will invoke call_rcu(), in which case the
next grace period will fail to take the running CPU's overload condition
into account.  Plus, because the bit is not set, the end of the grace
period won't check for overload on this CPU.

This commit therefore adds a call to check_cb_ovld_locked() in
rcutree_migrate_callbacks() to set the running CPU's ->cbovlmask bit
appropriately.

Signed-off-by: Zqiang <qiang1.zhang@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
kernel/rcu/tree.c