Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1617651 > unrolled thread

[PATCH 3/6] locking/locktorture: Fix rwsem reader_delay

Started byDavidlohr Bueso <dave@stgolabs.net>
First post2017-04-06 11:00 +0200
Last post2017-04-06 11:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/6] locking/locktorture: Fix rwsem reader_delay Davidlohr Bueso <dave@stgolabs.net> - 2017-04-06 11:00 +0200

#1617651 — [PATCH 3/6] locking/locktorture: Fix rwsem reader_delay

FromDavidlohr Bueso <dave@stgolabs.net>
Date2017-04-06 11:00 +0200
Subject[PATCH 3/6] locking/locktorture: Fix rwsem reader_delay
Message-ID<ttbqN-6ei-3@gated-at.bofh.it>
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>
---
 kernel/locking/locktorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index f24582d4dad3..0ef5510f8742 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -570,7 +570,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);
-- 
2.12.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web