diff options
author | Davidlohr Bueso <dave@stgolabs.net> | 2017-05-15 02:07:22 -0700 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2017-12-11 09:18:28 -0800 |
commit | f2f762608f45353b0b8c37507824f95bb716c3d5 (patch) | |
tree | b594c29c52d6d245b6cc4e39ff21dc8d8c7d055e /kernel | |
parent | 8f9dd8317386b0bcb20cf0bfc832ba2ea67f44d1 (diff) | |
download | linux-f2f762608f45353b0b8c37507824f95bb716c3d5.tar.gz linux-f2f762608f45353b0b8c37507824f95bb716c3d5.tar.bz2 linux-f2f762608f45353b0b8c37507824f95bb716c3d5.zip |
locking/locktorture: Fix rwsem reader_delay
We should account for nreader threads, not writers in this
callback. Could even trigger a div by 0 if the user explicitly
disables writers.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/locking/locktorture.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index 617cea2520b3..a307a79e6b0b 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c @@ -560,7 +560,7 @@ static void torture_rwsem_read_delay(struct torture_random_state *trsp) /* We want a long delay occasionally to force massive contention. */ if (!(torture_random(trsp) % - (cxt.nrealwriters_stress * 2000 * longdelay_ms))) + (cxt.nrealreaders_stress * 2000 * longdelay_ms))) mdelay(longdelay_ms * 2); else mdelay(longdelay_ms / 2); |