From: Breno Leitao <leitao@debian.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, rostedt@goodmis.org,
Puranjay Mohan <puranjay@kernel.org>,
Usama Arif <usama.arif@linux.dev>
Subject: Re: [PATCH v2 06/13] rcutorture: Add nwriters module parameter
Date: Fri, 31 Jul 2026 01:22:19 -0700 [thread overview]
Message-ID: <amxauiJZab9_3OKr@gmail.com> (raw)
In-Reply-To: <20260731010719.3531912-6-paulmck@kernel.org>
On Thu, Jul 30, 2026 at 06:07:12PM -0700, Paul E. McKenney wrote:
> Believe it or not, there are people who would like to run rcutorture
> without actually torturing RCU. For example, some people would like to
> induce various types of stall warnings without placing any unnecessary
> additional overhead on their systems running in production. And
> rcutorture provides the stall_cpu, stall_cpu_holdoff, stall_no_softlockup,
> stall_cpu_irqsoff, stall_cpu_block, and stall_cpu_repeat module parameters
> in order to allow the user to force numerous types of stalls. In addition,
> rcutorture provides a great number of other module parameters to allow the
> user to reduce other overhead.
>
> But unfortunately, there is no way to turn of the rcu_torture_writer()
> portion of this torture test, which on my x86 laptop consumes somewhere
> between 40% and 45% of a CPU. Although this is quite lightweight for a
> torture test, it is not welcome on systems running production workloads.
> This commit therefore adds an nwriters module parameter that defaults
> to 1 but can be set to 0 in order to disable the rcu_torture_writer()
> portion of the torture test, but that cannot be set to any other value
> (that is what the fakewriters module parameter is for!). This reduces
> the overhead to well under 1% of a CPU, which is much more likely to be
> compatible with production workloads.
>
> Reported-by: Breno Leitao <leitao@debian.org>
> Reported-by: Puranjay Mohan <puranjay@kernel.org>
> Reported-by: Usama Arif <usama.arif@linux.dev>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Breno Leitao <leitao@debian.org>
> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
...
> +torture_param(bool, nwriters, 1, "Number of RCU writer threads (0 or 1)");
It looks like you used `int` for the same parameter in hazptrtorure.c
and bool here
torture_param(int, nwriters, 1, "Number of hazard-pointer writer threads, 0 or 1");
Needeless to say that bool is more appropriate, and you don't need to
check it later.
WARN_ON(IS_BUILTIN(CONFIG_HAZPTR_TORTURE_TEST) && nwriters != 1);
Thanks for implementing it,
--breno
next prev parent reply other threads:[~2026-07-31 8:22 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 0:25 [PATCH 0/11] RCU torture-test updates for v7.3 Paul E. McKenney
2026-07-16 0:25 ` [PATCH 01/11] rcutorture: Abstract reader-segment dump into rcu_torture_dump_read_segs() Paul E. McKenney
2026-07-16 0:25 ` [PATCH 02/11] rcutorture: Check for immediate deboosting at reader end Paul E. McKenney
2026-07-16 0:25 ` [PATCH 03/11] rcutorture: Make srcu_read_delay() check for disabled interrupts Paul E. McKenney
2026-07-16 0:25 ` [PATCH 04/11] rcutorture: Test RCU readers from hardware interrupt handlers Paul E. McKenney
2026-07-16 0:25 ` [PATCH 05/11] rcutorture: Use cpumask_next_wrap() in rcu_torture_preempt() Paul E. McKenney
2026-07-16 0:25 ` [PATCH 06/11] rcutorture: Use task_state_to_char() for task-state reporting Paul E. McKenney
2026-07-16 0:25 ` [PATCH 07/11] rcutorture: Add nwriters module parameter Paul E. McKenney
2026-07-16 0:25 ` [PATCH 08/11] rcutorture: Add a stall_only " Paul E. McKenney
2026-07-16 0:25 ` [PATCH 09/11] rcutorture: Test RCU Tasks Trace GP implying RCU GP Paul E. McKenney
2026-07-16 0:25 ` [PATCH 10/11] rcutorture: Make RCU Tasks Trace track Reader Batches Paul E. McKenney
2026-07-16 0:25 ` [PATCH 11/11] rcutorture: Use this_cpu_inc() for rcu_torture_count[] and rcu_torture_batch[] Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 0/13] RCU torture-test updates for v7.3 Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 01/13] rcutorture: Abstract reader-segment dump into rcu_torture_dump_read_segs() Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 02/13] rcutorture: Check for immediate deboosting at reader end Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 03/13] rcutorture: Test RCU readers from hardware interrupt handlers Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 04/13] rcutorture: Use cpumask_next_wrap() in rcu_torture_preempt() Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 05/13] rcutorture: Use task_state_to_char() for task-state reporting Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 06/13] rcutorture: Add nwriters module parameter Paul E. McKenney
2026-07-31 8:22 ` Breno Leitao [this message]
2026-07-31 18:01 ` Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 07/13] rcutorture: Add a stall_only " Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 08/13] rcutorture: Test RCU Tasks Trace GP implying RCU GP Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 09/13] rcutorture: Make RCU Tasks Trace track Reader Batches Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 10/13] rcutorture: Use this_cpu_inc() for rcu_torture_count[] and rcu_torture_batch[] Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 11/13] torture: Don't leak shuffle_tmp_mask when shuffler kthread fails to start Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 12/13] rcutorture: Announce declining to forward-progress test Paul E. McKenney
2026-07-31 1:07 ` [PATCH v2 13/13] rcutorture: Make {,s}rcu_read_delay() better handle forward-progress testing 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=amxauiJZab9_3OKr@gmail.com \
--to=leitao@debian.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=puranjay@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=usama.arif@linux.dev \
/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