rcu: Don't funnel-lock above leaf node if GP in progress
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sat, 12 May 2018 14:42:20 +0000 (07:42 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 12 Jul 2018 22:38:52 +0000 (15:38 -0700)
commita2165e416878b325747f871df4b236b49bf61486
treef34e198b527f5a69380b72a311076e1f26e26268
parente1333462e3cf933ab860c693ef1ff50775c7ea7f
rcu: Don't funnel-lock above leaf node if GP in progress

The old grace-period start code would acquire only the leaf's rcu_node
structure's ->lock if that structure believed that a grace period was
in progress.  The new code advances to the leaf's parent in this case,
needlessly acquiring then leaf's parent's ->lock.  This commit therefore
checks the grace-period state after marking the leaf with the need for
the specified grace period, and if the leaf believes that a grace period
is in progress, takes an early exit.

Reported-by: Joel Fernandes <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
[ paulmck: Add "Startedleaf" tracing as suggested by Joel Fernandes. ]
include/trace/events/rcu.h
kernel/rcu/tree.c