locktorture: Add call_rcu_chains module parameter
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 22 Aug 2023 02:36:10 +0000 (19:36 -0700)
committerFrederic Weisbecker <frederic@kernel.org>
Sun, 24 Sep 2023 15:24:02 +0000 (17:24 +0200)
commit7f993623e9ebcd633c0f760991e5078b95a37db3
tree56e27b510bbf03843c8f5ea507fa7a7f4e922749
parent00c24c9cfa7895d6e712bea6f7109911cfdd54d0
locktorture: Add call_rcu_chains module parameter

When running locktorture on large systems, there will normally be
enough RCU activity to ensure that there is a grace period in flight
at all times.  However, on smaller systems, RCU might well be idle the
majority of the time.  This situation can be inconvenient in cases where
the RCU CPU stall warning is part of the debugging process.

This commit therefore adds an call_rcu_chains module parameter to
locktorture, allowing the user to specify the desired number of
self-propagating call_rcu() chains.  For good measure, immediately
before invoking call_rcu(), the self-propagating RCU callback invokes
start_poll_synchronize_rcu() to force the immediate start of a grace
period, with the call_rcu() forcing another to start shortly thereafter.

Booting with locktorture.call_rcu_chains=2 increases the probability
of a stuck locking primitive resulting in an RCU CPU stall warning from
about 25% to nearly 100%.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Documentation/admin-guide/kernel-parameters.txt
kernel/locking/locktorture.c