srcu: Remove needless rcu_seq_done() check while holding read lock
authorPingfan Liu <kernelfans@gmail.com>
Wed, 23 Nov 2022 13:56:37 +0000 (21:56 +0800)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 4 Jan 2023 01:49:23 +0000 (17:49 -0800)
commit1bafbfb3e1a18af7f404977ed0d218dc4f176f8e
tree4b7457482905c85e7491dfa10b34c8d847a9e276
parentefa3c40cfac0777071e30383d209534e09ee454b
srcu: Remove needless rcu_seq_done() check while holding read lock

The srcu_gp_start_if_needed() function now read-holds the srcu_struct
whose grace period is being started, which means that the corresponding
SRCU grace period cannot end.  This in turn means that the SRCU
grace-period sequence number returned by rcu_seq_snap() cannot expire
during this time.  And that means that the calls to rcu_seq_done() in
srcu_funnel_exp_start() and srcu_funnel_gp_start() can never return true.

This commit therefore removes these rcu_seq_done() checks, but adds checks
in kernels built with CONFIG_PROVE_RCU=y that splats if rcu_seq_done()
does somehow return true.

[ paulmck: Rearrange checks to handle kernels built with lockdep. ]

Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: rcu@vger.kernel.org
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/srcutree.c