rcu/tree: Reduce wake up for synchronize_rcu() common case
authorJoel Fernandes (Google) <joel@joelfernandes.org>
Tue, 19 Mar 2024 18:54:57 +0000 (14:54 -0400)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 18 Jun 2024 16:59:40 +0000 (09:59 -0700)
commit6f948568fdc66429c9f70e2cecde0664655cc870
tree86112f2aabb95b2b1d67764c8963d97e4e231307
parent32d99593bdc91442fe6183d97b060210cc9c8193
rcu/tree: Reduce wake up for synchronize_rcu() common case

In the synchronize_rcu() common case, we will have less than
SR_MAX_USERS_WAKE_FROM_GP number of users per GP. Waking up the kworker
is pointless just to free the last injected wait head since at that point,
all the users have already been awakened.

Introduce a new counter to track this and prevent the wakeup in the
common case.

[ paulmck: Remove atomic_dec_return_release in cannot-happen state. ]

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c
kernel/rcu/tree.h