<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/locking/locktorture.c, branch v6.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.4</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-03-07T18:13:57Z</updated>
<entry>
<title>locktorture: Add raw_spinlock* torture tests for PREEMPT_RT kernels</title>
<updated>2023-03-07T18:13:57Z</updated>
<author>
<name>Zqiang</name>
<email>qiang1.zhang@intel.com</email>
</author>
<published>2023-02-24T01:20:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5d65cf6ae6aea1a8d533d4499201a13d0068a0dc'/>
<id>urn:sha1:5d65cf6ae6aea1a8d533d4499201a13d0068a0dc</id>
<content type='text'>
In PREEMPT_RT kernels, both spin_lock() and spin_lock_irq() are converted
to sleepable rt_spin_lock().  This means that the interrupt related
suffixes for spin_lock/unlock(_irq, irqsave/irqrestore) do not affect
the CPU's interrupt state. This commit therefore adds raw spin-lock
torture tests.  This in turn permits pure spin locks to be tested in
PREEMPT_RT kernels.

Suggested-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Suggested-by: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Signed-off-by: Zqiang &lt;qiang1.zhang@intel.com&gt;
Reviewed-by: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>locktorture: With nested locks, occasionally skip main lock</title>
<updated>2023-03-07T18:13:57Z</updated>
<author>
<name>John Stultz</name>
<email>jstultz@google.com</email>
</author>
<published>2023-02-21T19:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=45bcf0bd8cbe163c5aec18570b6befd2193f1a57'/>
<id>urn:sha1:45bcf0bd8cbe163c5aec18570b6befd2193f1a57</id>
<content type='text'>
If we're using nested locking to stress things, occasionally
skip taking the main lock, so that we can get some different
contention patterns between the writers (to hopefully get two
disjoint blocked trees)

Cc: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Cc: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Joel Fernandes &lt;joel@joelfernandes.org&gt;
Cc: Juri Lelli &lt;juri.lelli@redhat.com&gt;
Cc: Valentin Schneider &lt;vschneid@redhat.com&gt;
Cc: Dietmar Eggemann &lt;dietmar.eggemann@arm.com&gt;
Cc: kernel-team@android.com
Co-developed-by: Connor O'Brien &lt;connoro@google.com&gt;
Signed-off-by: Connor O'Brien &lt;connoro@google.com&gt;
Signed-off-by: John Stultz &lt;jstultz@google.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>locktorture: Add nested locking to rtmutex torture tests</title>
<updated>2023-03-07T18:13:57Z</updated>
<author>
<name>John Stultz</name>
<email>jstultz@google.com</email>
</author>
<published>2023-02-21T19:02:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ae4823e427954d30ab393888a334f9d1fd8cd597'/>
<id>urn:sha1:ae4823e427954d30ab393888a334f9d1fd8cd597</id>
<content type='text'>
This patch adds randomized nested locking to the rtmutex torture
tests. Additionally it adds LOCK09 config files for testing
rtmutexes with nested locking.

Cc: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Cc: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Joel Fernandes &lt;joel@joelfernandes.org&gt;
Cc: Juri Lelli &lt;juri.lelli@redhat.com&gt;
Cc: Valentin Schneider &lt;vschneid@redhat.com&gt;
Cc: Dietmar Eggemann &lt;dietmar.eggemann@arm.com&gt;
Cc: kernel-team@android.com
Reviewed-by: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Co-developed-by: Connor O'Brien &lt;connoro@google.com&gt;
Signed-off-by: Connor O'Brien &lt;connoro@google.com&gt;
Signed-off-by: John Stultz &lt;jstultz@google.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>locktorture: Add nested locking to mutex torture tests</title>
<updated>2023-03-07T18:13:57Z</updated>
<author>
<name>John Stultz</name>
<email>jstultz@google.com</email>
</author>
<published>2023-02-21T19:02:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3e5aeaf53422bdd79fecf89aa160f048114e013c'/>
<id>urn:sha1:3e5aeaf53422bdd79fecf89aa160f048114e013c</id>
<content type='text'>
This patch adds randomized nested locking to the mutex torture
tests, as well as new LOCK08 config files for testing mutexes
with nested locking

Cc: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Cc: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Joel Fernandes &lt;joel@joelfernandes.org&gt;
Cc: Juri Lelli &lt;juri.lelli@redhat.com&gt;
Cc: Valentin Schneider &lt;vschneid@redhat.com&gt;
Cc: Dietmar Eggemann &lt;dietmar.eggemann@arm.com&gt;
Cc: kernel-team@android.com
Reviewed-by: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Co-developed-by: Connor O'Brien &lt;connoro@google.com&gt;
Signed-off-by: Connor O'Brien &lt;connoro@google.com&gt;
Signed-off-by: John Stultz &lt;jstultz@google.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>locktorture: Add nested_[un]lock() hooks and nlocks parameter</title>
<updated>2023-03-07T18:13:57Z</updated>
<author>
<name>John Stultz</name>
<email>jstultz@google.com</email>
</author>
<published>2023-02-21T19:02:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b63343207da21179d82df933f42a1725a53b9a63'/>
<id>urn:sha1:b63343207da21179d82df933f42a1725a53b9a63</id>
<content type='text'>
In order to extend locktorture to support lock nesting, add
nested_lock() and nested_unlock() hooks to the torture ops.

These take a 32bit lockset mask which is generated at random,
so some number of locks will be taken before the main lock is
taken and released afterwards.

Additionally, add nested_locks module parameter to allow
specifying the number of nested locks to be used.

This has been helpful to uncover issues in the proxy-exec
series development.

This was inspired by locktorture extensions originally implemented
by Connor O'Brien, for stress testing the proxy-execution series:
  https://lore.kernel.org/lkml/20221003214501.2050087-12-connoro@google.com/

Cc: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Cc: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Joel Fernandes &lt;joel@joelfernandes.org&gt;
Cc: Juri Lelli &lt;juri.lelli@redhat.com&gt;
Cc: Valentin Schneider &lt;vschneid@redhat.com&gt;
Cc: Dietmar Eggemann &lt;dietmar.eggemann@arm.com&gt;
Cc: kernel-team@android.com
Reviewed-by: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Co-developed-by: Connor O'Brien &lt;connoro@google.com&gt;
Signed-off-by: Connor O'Brien &lt;connoro@google.com&gt;
Signed-off-by: John Stultz &lt;jstultz@google.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>locktorture: Make the rt_boost factor a tunable</title>
<updated>2023-01-05T20:10:35Z</updated>
<author>
<name>Joel Fernandes (Google)</name>
<email>joel@joelfernandes.org</email>
</author>
<published>2022-12-13T20:48:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c24501b240741907ddfce52ffc186792db5ad3a5'/>
<id>urn:sha1:c24501b240741907ddfce52ffc186792db5ad3a5</id>
<content type='text'>
The rt boosting in locktorture has a factor variable s currently large enough
that boosting only happens once every minute or so. Add a tunable to reduce the
factor so that boosting happens more often, to test paths and arrive at failure
modes earlier. With this change, I can set the factor to like 50 and have the
boosting happens every 10 seconds or so.

Tested with boot parameters:
locktorture.torture_type=mutex_lock
locktorture.onoff_interval=1
locktorture.nwriters_stress=8
locktorture.stutter=0
locktorture.rt_boost=1
locktorture.rt_boost_factor=50
locktorture.nlocks=3

Signed-off-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Reviewed-by: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>locktorture: Allow non-rtmutex lock types to be boosted</title>
<updated>2023-01-05T20:10:35Z</updated>
<author>
<name>Joel Fernandes (Google)</name>
<email>joel@joelfernandes.org</email>
</author>
<published>2022-12-13T20:48:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e01f3a1a589e314cf27bd2cb27d9c2c58e105a27'/>
<id>urn:sha1:e01f3a1a589e314cf27bd2cb27d9c2c58e105a27</id>
<content type='text'>
Currently RT boosting is only done for rtmutex_lock, however with proxy
execution, we also have the mutex_lock participating in priorities. To
exercise the testing better, add RT boosting to other lock testing types
as well, using a new knob (rt_boost).

Tested with boot parameters:
locktorture.torture_type=mutex_lock
locktorture.onoff_interval=1
locktorture.nwriters_stress=8
locktorture.stutter=0
locktorture.rt_boost=1
locktorture.rt_boost_factor=1
locktorture.nlocks=3

Signed-off-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>locktorture,rcutorture,torture: Always log error message</title>
<updated>2021-12-08T00:36:17Z</updated>
<author>
<name>Li Zhijian</name>
<email>zhijianx.li@intel.com</email>
</author>
<published>2021-11-03T08:30:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=81faa4f6fba429334ff72bb5ba7696818509b5b5'/>
<id>urn:sha1:81faa4f6fba429334ff72bb5ba7696818509b5b5</id>
<content type='text'>
Unconditionally log messages corresponding to errors.

Acked-by: Davidlohr Bueso &lt;dbueso@suse.de&gt;
Signed-off-by: Li Zhijian &lt;zhijianx.li@intel.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>locktorture: Warn on individual lock_torture_init() error conditions</title>
<updated>2021-09-13T23:36:16Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@kernel.org</email>
</author>
<published>2021-08-05T22:53:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b3b3cc618ee07f5f4c409e8ca86ac7fbac085ebd'/>
<id>urn:sha1:b3b3cc618ee07f5f4c409e8ca86ac7fbac085ebd</id>
<content type='text'>
When running locktorture as a module, any lock_torture_init() issues will be
reflected in the error code from modprobe or insmod, as the case may be.
However, these error codes are not available when running locktorture
built-in, for example, when using the kvm.sh script.  This commit
therefore adds WARN_ON_ONCE() to allow distinguishing lock_torture_init()
errors when running locktorture built-in.

Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>locktorture: Count lock readers</title>
<updated>2021-07-27T18:39:30Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@kernel.org</email>
</author>
<published>2021-06-02T23:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=af5f6e27d52cdb2cb3826df19a69a74e9d5eff5e'/>
<id>urn:sha1:af5f6e27d52cdb2cb3826df19a69a74e9d5eff5e</id>
<content type='text'>
Currently, the lock_is_read_held variable is bool, so that a reader sets
it to true just after lock acquisition and then to false just before
lock release.  This works in a rough statistical sense, but can result
in false negatives just after one of a pair of concurrent readers has
released the lock.  This approach does have low overhead, but at the
expense of the setting to true potentially never leaving the reader's
store buffer, thus resulting in an unconditional false negative.

This commit therefore converts this variable to atomic_t and makes
the reader use atomic_inc() just after acquisition and atomic_dec()
just before release.  This does increase overhead, but this increase is
negligible compared to the 10-microsecond lock hold time.

Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
</feed>
