All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Neeraj Upadhyay <neeraj.upadhyay@amd.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Uladzislau Rezki <urezki@gmail.com>, rcu <rcu@vger.kernel.org>,
	Frederic Weisbecker <frederic@kernel.org>
Subject: [PATCH 18/23] locktorture: Rename readers_bind/writers_bind to bind_readers/bind_writers
Date: Tue, 10 Oct 2023 13:59:16 +0200	[thread overview]
Message-ID: <20231010115921.988766-19-frederic@kernel.org> (raw)
In-Reply-To: <20231010115921.988766-1-frederic@kernel.org>

From: "Paul E. McKenney" <paulmck@kernel.org>

This commit renames the readers_bind and writers_bind module parameters
to bind_readers and bind_writers, respectively.  This provides added
clarity via the imperative mode and better organizes the documentation.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 .../admin-guide/kernel-parameters.txt         | 16 +++++------
 kernel/locking/locktorture.c                  | 28 +++++++++----------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 47f8b1cef4fd..1d539c6d9d1c 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2918,6 +2918,14 @@
 			acquisition.  Acquisitions exceeding this limit
 			will result in a splat once they do complete.
 
+	locktorture.bind_readers= [KNL]
+			Specify the list of CPUs to which the readers are
+			to be bound.
+
+	locktorture.bind_writers= [KNL]
+			Specify the list of CPUs to which the writers are
+			to be bound.
+
 	locktorture.call_rcu_chains= [KNL]
 			Specify the number of self-propagating call_rcu()
 			chains to set up.  These are used to ensure that
@@ -2952,10 +2960,6 @@
 			Set time (s) between CPU-hotplug operations, or
 			zero to disable CPU-hotplug testing.
 
-	locktorture.readers_bind= [KNL]
-			Specify the list of CPUs to which the readers are
-			to be bound.
-
 	locktorture.rt_boost= [KNL]
 			Do periodic testing of real-time lock priority
 			boosting.  Select 0 to disable, 1 to boost
@@ -3000,10 +3004,6 @@
 	locktorture.verbose= [KNL]
 			Enable additional printk() statements.
 
-	locktorture.writers_bind= [KNL]
-			Specify the list of CPUs to which the writers are
-			to be bound.
-
 	locktorture.writer_fifo= [KNL]
 			Run the write-side locktorture kthreads at
 			sched_set_fifo() real-time priority.
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index 01d56e6c44d7..a3abcd136f56 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -58,8 +58,8 @@ module_param(torture_type, charp, 0444);
 MODULE_PARM_DESC(torture_type,
 		 "Type of lock to torture (spin_lock, spin_lock_irq, mutex_lock, ...)");
 
-static cpumask_var_t readers_bind; // Bind the readers to the specified set of CPUs.
-static cpumask_var_t writers_bind; // Bind the writers to the specified set of CPUs.
+static cpumask_var_t bind_readers; // Bind the readers to the specified set of CPUs.
+static cpumask_var_t bind_writers; // Bind the writers to the specified set of CPUs.
 
 // Parse a cpumask kernel parameter.  If there are more users later on,
 // this might need to got to a more central location.
@@ -102,8 +102,8 @@ static const struct kernel_param_ops lt_bind_ops = {
 	.get = param_get_cpumask,
 };
 
-module_param_cb(readers_bind, &lt_bind_ops, &readers_bind, 0644);
-module_param_cb(writers_bind, &lt_bind_ops, &writers_bind, 0644);
+module_param_cb(bind_readers, &lt_bind_ops, &bind_readers, 0644);
+module_param_cb(bind_writers, &lt_bind_ops, &bind_writers, 0644);
 
 long torture_sched_setaffinity(pid_t pid, const struct cpumask *in_mask);
 
@@ -1039,18 +1039,18 @@ lock_torture_print_module_parms(struct lock_torture_ops *cur_ops,
 				const char *tag)
 {
 	static cpumask_t cpumask_all;
-	cpumask_t *rcmp = cpumask_nonempty(readers_bind) ? readers_bind : &cpumask_all;
-	cpumask_t *wcmp = cpumask_nonempty(writers_bind) ? writers_bind : &cpumask_all;
+	cpumask_t *rcmp = cpumask_nonempty(bind_readers) ? bind_readers : &cpumask_all;
+	cpumask_t *wcmp = cpumask_nonempty(bind_writers) ? bind_writers : &cpumask_all;
 
 	cpumask_setall(&cpumask_all);
 	pr_alert("%s" TORTURE_FLAG
-		 "--- %s%s: acq_writer_lim=%d call_rcu_chains=%d long_hold=%d nested_locks=%d nreaders_stress=%d nwriters_stress=%d onoff_holdoff=%d onoff_interval=%d rt_boost=%d rt_boost_factor=%d shuffle_interval=%d shutdown_secs=%d stat_interval=%d stutter=%d verbose=%d writer_fifo=%d readers_bind=%*pbl writers_bind=%*pbl\n",
+		 "--- %s%s: acq_writer_lim=%d bind_readers=%*pbl bind_writers=%*pbl call_rcu_chains=%d long_hold=%d nested_locks=%d nreaders_stress=%d nwriters_stress=%d onoff_holdoff=%d onoff_interval=%d rt_boost=%d rt_boost_factor=%d shuffle_interval=%d shutdown_secs=%d stat_interval=%d stutter=%d verbose=%d writer_fifo=%d\n",
 		 torture_type, tag, cxt.debug_lock ? " [debug]": "",
-		 acq_writer_lim, call_rcu_chains, long_hold, nested_locks, cxt.nrealreaders_stress,
+		 acq_writer_lim, cpumask_pr_args(rcmp), cpumask_pr_args(wcmp),
+		 call_rcu_chains, long_hold, nested_locks, cxt.nrealreaders_stress,
 		 cxt.nrealwriters_stress, onoff_holdoff, onoff_interval, rt_boost,
 		 rt_boost_factor, shuffle_interval, shutdown_secs, stat_interval, stutter,
-		 verbose, writer_fifo,
-		 cpumask_pr_args(rcmp), cpumask_pr_args(wcmp));
+		 verbose, writer_fifo);
 }
 
 // If requested, maintain call_rcu() chains to keep a grace period always
@@ -1356,8 +1356,8 @@ static int __init lock_torture_init(void)
 						     writer_fifo ? sched_set_fifo : NULL);
 		if (torture_init_error(firsterr))
 			goto unwind;
-		if (cpumask_nonempty(writers_bind))
-			torture_sched_setaffinity(writer_tasks[i]->pid, writers_bind);
+		if (cpumask_nonempty(bind_writers))
+			torture_sched_setaffinity(writer_tasks[i]->pid, bind_writers);
 
 	create_reader:
 		if (cxt.cur_ops->readlock == NULL || (j >= cxt.nrealreaders_stress))
@@ -1367,8 +1367,8 @@ static int __init lock_torture_init(void)
 						  reader_tasks[j]);
 		if (torture_init_error(firsterr))
 			goto unwind;
-		if (cpumask_nonempty(readers_bind))
-			torture_sched_setaffinity(reader_tasks[j]->pid, readers_bind);
+		if (cpumask_nonempty(bind_readers))
+			torture_sched_setaffinity(reader_tasks[j]->pid, bind_readers);
 	}
 	if (stat_interval > 0) {
 		firsterr = torture_create_kthread(lock_torture_stats, NULL,
-- 
2.34.1


  parent reply	other threads:[~2023-10-10 12:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 11:58 [PATCH 00/23] RCU/lock torture updates for v6.7 Frederic Weisbecker
2023-10-10 11:58 ` [PATCH 01/23] torture: Share torture_random_state with torture_shuffle_tasks() Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 02/23] torture: Make kvm-recheck.sh use mktemp Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 03/23] torture: Make torture_hrtimeout_ns() take an hrtimer mode parameter Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 04/23] rcu: Include torture_sched_setaffinity() declaration Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 05/23] torture: Move rcutorture_sched_setaffinity() out of rcutorture Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 06/23] locktorture: Add readers_bind and writers_bind module parameters Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 07/23] rcutorture: Add CONFIG_DEBUG_OBJECTS to RCU Tasks testing Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 08/23] rcutorture: Fix stuttering races and other issues Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 09/23] locktorture: Alphabetize torture_param() entries Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 10/23] locktorture: Consolidate "if" statements in lock_torture_writer() Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 11/23] locktorture: Add acq_writer_lim to complain about long acquistion times Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 12/23] rcutorture: Copy out ftrace into its own console file Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 13/23] torture: Print out torture module parameters Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 14/23] torture: Make torture.sh refscale testing qualify verbose_batched Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 15/23] locktorture: Add new module parameters to lock_torture_print_module_parms() Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 16/23] locktorture: Add call_rcu_chains module parameter Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 17/23] doc: Catch-up update for locktorture module parameters Frederic Weisbecker
2023-10-10 11:59 ` Frederic Weisbecker [this message]
2023-10-10 11:59 ` [PATCH 19/23] torture: Add kvm.sh --debug-info argument Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 20/23] rcutorture: Replace schedule_timeout*() 1-jiffy waits with HZ/20 Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 21/23] rcutorture: Traverse possible cpu to set maxcpu in rcu_nocb_toggle() Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 22/23] torture: Convert parse-console.sh to mktemp Frederic Weisbecker
2023-10-10 11:59 ` [PATCH 23/23] locktorture: Check the correct variable for allocation failure Frederic Weisbecker
2023-10-10 13:55   ` Paul E. McKenney
2023-10-10 14:07     ` Dan Carpenter
2023-10-10 15:53       ` Paul E. McKenney
2023-10-11  6:46         ` Dan Carpenter

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=20231010115921.988766-19-frederic@kernel.org \
    --to=frederic@kernel.org \
    --cc=boqun.feng@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=neeraj.upadhyay@amd.com \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=urezki@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.