rcu/nocb: Prepare nocb_cb_wait() to start with a non-offloaded rdp
authorFrederic Weisbecker <frederic@kernel.org>
Tue, 23 Nov 2021 00:37:04 +0000 (01:37 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 9 Dec 2021 19:34:30 +0000 (11:34 -0800)
commit8d9703964697340e073305574de4f5df31a28ba9
tree333f77ce10c57a1f9e6bcf4040bb2e48bc3617ff
parent2ebc45c44c4f3cc4c757430b2409ece4f976892e
rcu/nocb: Prepare nocb_cb_wait() to start with a non-offloaded rdp

In order to be able to toggle the offloaded state from cpusets, a nocb
kthread will need to be created for all possible CPUs whenever either
of the "rcu_nocbs=" or "nohz_full=" parameters are specified.

Therefore, the nocb_cb_wait() kthread must be prepared to start running
on a de-offloaded rdp.  To accomplish this, simply move the sleeping
condition to the beginning of the nocb_cb_wait() function, which prevents
this kthread from attempting to invoke callbacks before the corresponding
CPU is offloaded.

Reviewed-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Uladzislau Rezki <urezki@gmail.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Joel Fernandes <joel@joelfernandes.org>
Tested-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree_nocb.h