rcu: Fix late wakeup when flush of bypass cblist happens
authorJoel Fernandes (Google) <joel@joelfernandes.org>
Sat, 17 Sep 2022 16:41:59 +0000 (16:41 +0000)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 18 Oct 2022 22:00:36 +0000 (15:00 -0700)
commitb50606f35f4b73c8e4c6b9c64fe7ba72ea919134
tree8306bb530ec25e6e0096df13760bad5ba8658874
parentf1ffec1ea30fdd4c101c78af2be376d8c1cf46b7
rcu: Fix late wakeup when flush of bypass cblist happens

When the bypass cblist gets too big or its timeout has occurred, it is
flushed into the main cblist. However, the bypass timer is still running
and the behavior is that it would eventually expire and wake the GP
thread.

Since we are going to use the bypass cblist for lazy CBs, do the wakeup
soon as the flush for "too big or too long" bypass list happens.
Otherwise, long delays can happen for callbacks which get promoted from
lazy to non-lazy.

This is a good thing to do anyway (regardless of future lazy patches),
since it makes the behavior consistent with behavior of other code paths
where flushing into the ->cblist makes the GP kthread into a
non-sleeping state quickly.

[ Frederic Weisbecker: Changes to avoid unnecessary GP-thread wakeups plus
    comment changes. ]

Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree_nocb.h