]> git.ipfire.org Git - thirdparty/linux.git/commit
rcutorture: Check for ->up_read() without matching ->down_read()
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 10 Feb 2025 17:29:35 +0000 (09:29 -0800)
committerNeeraj Upadhyay (AMD) <neeraj.upadhyay@kernel.org>
Wed, 25 Jun 2025 03:09:01 +0000 (08:39 +0530)
commit93856948be8f5d784a28cfb2eb16884a5522faaa
treee8dc382f98fd24232070182016c6e8b5e5a48b1d
parent62d92c9b87db43cc255411fe2827b9de42fa0523
rcutorture: Check for ->up_read() without matching ->down_read()

This commit creates counters in the rcu_torture_one_read_state_updown
structure that check for a call to ->up_read() that lacks a matching
call to ->down_read().

While in the area, add end-of-run cleanup code that prevents calls to
rcu_torture_updown_hrt() from happening after the test has moved on.  Yes,
the srcu_barrier() at the end of the test will wait for them, but this
could result in confusing states, statistics, and diagnostic information.
So explicitly wait for them before we get to the end-of-test output.

[ paulmck: Apply kernel test robot feedback. ]
[ joel: Apply Boqun's fix for counter increment ordering. ]

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Tested-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Neeraj Upadhyay (AMD) <neeraj.upadhyay@kernel.org>
kernel/rcu/rcutorture.c