From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
rostedt@goodmis.org, "Paul E. McKenney" <paulmck@kernel.org>
Subject: [PATCH rcu 8/9] torture: Stop right-shifting torture_random() return values
Date: Mon, 17 Jul 2023 11:20:41 -0700 [thread overview]
Message-ID: <20230717182042.1098651-8-paulmck@kernel.org> (raw)
In-Reply-To: <bca717ca-a83a-4540-80ec-732c12623d2d@paulmck-laptop>
Now that torture_random() uses swahw32(), its callers no longer see
not-so-random low-order bits, as these are now swapped up into the upper
16 bits of the torture_random() function's return value. This commit
therefore removes the right-shifting of torture_random() return values.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
kernel/torture.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/torture.c b/kernel/torture.c
index 92704f04a141..b59eb6048eab 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -95,7 +95,7 @@ int torture_hrtimeout_ns(ktime_t baset_ns, u32 fuzzt_ns, struct torture_random_s
ktime_t hto = baset_ns;
if (trsp)
- hto += (torture_random(trsp) >> 3) % fuzzt_ns;
+ hto += torture_random(trsp) % fuzzt_ns;
set_current_state(TASK_IDLE);
return schedule_hrtimeout(&hto, HRTIMER_MODE_REL);
}
@@ -365,7 +365,7 @@ torture_onoff(void *arg)
torture_hrtimeout_jiffies(HZ / 10, &rand);
continue;
}
- cpu = (torture_random(&rand) >> 4) % (maxcpu + 1);
+ cpu = torture_random(&rand) % (maxcpu + 1);
if (!torture_offline(cpu,
&n_offline_attempts, &n_offline_successes,
&sum_offline, &min_offline, &max_offline))
--
2.40.1
next prev parent reply other threads:[~2023-07-17 18:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 18:20 [PATCH rcu 0/9] Torture-test updates for v6.6 Paul E. McKenney
2023-07-17 18:20 ` [PATCH rcu 1/9] rcutorture: Dump grace-period state upon rtort_pipe_count incidents Paul E. McKenney
2023-07-17 18:20 ` [PATCH rcu 2/9] torture: Support randomized shuffling for proxy exec testing Paul E. McKenney
2023-07-17 18:20 ` [PATCH rcu 3/9] torture: Add lock_torture_writer_fifo module param Paul E. McKenney
2023-07-28 3:22 ` Paul E. McKenney
2023-07-28 3:22 ` [PATCH rcu 1/2] torture: Add a kthread-creation callback to _torture_create_kthread() Paul E. McKenney
2023-08-05 22:44 ` Joel Fernandes
2023-08-08 3:26 ` John Stultz
2023-07-28 3:22 ` [PATCH rcu 2/2] torture: Add lock_torture writer_fifo module parameter Paul E. McKenney
2023-08-08 3:27 ` John Stultz
2023-08-08 4:00 ` Paul E. McKenney
2023-07-17 18:20 ` [PATCH rcu 4/9] torture: Make torture_hrtimeout_*() use TASK_IDLE Paul E. McKenney
2023-07-17 18:20 ` [PATCH rcu 5/9] torture: Move torture_onoff() timeouts to hrtimers Paul E. McKenney
2023-07-17 18:20 ` [PATCH rcu 6/9] torture: Move torture_shuffle() " Paul E. McKenney
2023-07-17 18:20 ` [PATCH rcu 7/9] torture: Move stutter_wait() " Paul E. McKenney
2023-07-17 18:20 ` Paul E. McKenney [this message]
2023-07-17 18:20 ` [PATCH rcu 9/9] rcutorture: Stop right-shifting torture_random() return values Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230717182042.1098651-8-paulmck@kernel.org \
--to=paulmck@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®