rcu/tree: Reduce kworker 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.

TODO: Look into workqueue crap, is it possible a work is not queued
since the old one was pending and we still incremented the new counter.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
2 files changed