Skip to content

Commit 2273799

Browse files
paulmckrcuFrederic Weisbecker
authored andcommitted
locktorture: Rename readers_bind/writers_bind to bind_readers/bind_writers
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>
1 parent b1326d7 commit 2273799

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2918,6 +2918,14 @@
29182918
acquisition. Acquisitions exceeding this limit
29192919
will result in a splat once they do complete.
29202920

2921+
locktorture.bind_readers= [KNL]
2922+
Specify the list of CPUs to which the readers are
2923+
to be bound.
2924+
2925+
locktorture.bind_writers= [KNL]
2926+
Specify the list of CPUs to which the writers are
2927+
to be bound.
2928+
29212929
locktorture.call_rcu_chains= [KNL]
29222930
Specify the number of self-propagating call_rcu()
29232931
chains to set up. These are used to ensure that
@@ -2952,10 +2960,6 @@
29522960
Set time (s) between CPU-hotplug operations, or
29532961
zero to disable CPU-hotplug testing.
29542962

2955-
locktorture.readers_bind= [KNL]
2956-
Specify the list of CPUs to which the readers are
2957-
to be bound.
2958-
29592963
locktorture.rt_boost= [KNL]
29602964
Do periodic testing of real-time lock priority
29612965
boosting. Select 0 to disable, 1 to boost
@@ -3000,10 +3004,6 @@
30003004
locktorture.verbose= [KNL]
30013005
Enable additional printk() statements.
30023006

3003-
locktorture.writers_bind= [KNL]
3004-
Specify the list of CPUs to which the writers are
3005-
to be bound.
3006-
30073007
locktorture.writer_fifo= [KNL]
30083008
Run the write-side locktorture kthreads at
30093009
sched_set_fifo() real-time priority.

kernel/locking/locktorture.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ module_param(torture_type, charp, 0444);
5858
MODULE_PARM_DESC(torture_type,
5959
"Type of lock to torture (spin_lock, spin_lock_irq, mutex_lock, ...)");
6060

61-
static cpumask_var_t readers_bind; // Bind the readers to the specified set of CPUs.
62-
static cpumask_var_t writers_bind; // Bind the writers to the specified set of CPUs.
61+
static cpumask_var_t bind_readers; // Bind the readers to the specified set of CPUs.
62+
static cpumask_var_t bind_writers; // Bind the writers to the specified set of CPUs.
6363

6464
// Parse a cpumask kernel parameter. If there are more users later on,
6565
// this might need to got to a more central location.
@@ -102,8 +102,8 @@ static const struct kernel_param_ops lt_bind_ops = {
102102
.get = param_get_cpumask,
103103
};
104104

105-
module_param_cb(readers_bind, &lt_bind_ops, &readers_bind, 0644);
106-
module_param_cb(writers_bind, &lt_bind_ops, &writers_bind, 0644);
105+
module_param_cb(bind_readers, &lt_bind_ops, &bind_readers, 0644);
106+
module_param_cb(bind_writers, &lt_bind_ops, &bind_writers, 0644);
107107

108108
long torture_sched_setaffinity(pid_t pid, const struct cpumask *in_mask);
109109

@@ -1039,18 +1039,18 @@ lock_torture_print_module_parms(struct lock_torture_ops *cur_ops,
10391039
const char *tag)
10401040
{
10411041
static cpumask_t cpumask_all;
1042-
cpumask_t *rcmp = cpumask_nonempty(readers_bind) ? readers_bind : &cpumask_all;
1043-
cpumask_t *wcmp = cpumask_nonempty(writers_bind) ? writers_bind : &cpumask_all;
1042+
cpumask_t *rcmp = cpumask_nonempty(bind_readers) ? bind_readers : &cpumask_all;
1043+
cpumask_t *wcmp = cpumask_nonempty(bind_writers) ? bind_writers : &cpumask_all;
10441044

10451045
cpumask_setall(&cpumask_all);
10461046
pr_alert("%s" TORTURE_FLAG
1047-
"--- %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",
1047+
"--- %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",
10481048
torture_type, tag, cxt.debug_lock ? " [debug]": "",
1049-
acq_writer_lim, call_rcu_chains, long_hold, nested_locks, cxt.nrealreaders_stress,
1049+
acq_writer_lim, cpumask_pr_args(rcmp), cpumask_pr_args(wcmp),
1050+
call_rcu_chains, long_hold, nested_locks, cxt.nrealreaders_stress,
10501051
cxt.nrealwriters_stress, onoff_holdoff, onoff_interval, rt_boost,
10511052
rt_boost_factor, shuffle_interval, shutdown_secs, stat_interval, stutter,
1052-
verbose, writer_fifo,
1053-
cpumask_pr_args(rcmp), cpumask_pr_args(wcmp));
1053+
verbose, writer_fifo);
10541054
}
10551055

10561056
// If requested, maintain call_rcu() chains to keep a grace period always
@@ -1356,8 +1356,8 @@ static int __init lock_torture_init(void)
13561356
writer_fifo ? sched_set_fifo : NULL);
13571357
if (torture_init_error(firsterr))
13581358
goto unwind;
1359-
if (cpumask_nonempty(writers_bind))
1360-
torture_sched_setaffinity(writer_tasks[i]->pid, writers_bind);
1359+
if (cpumask_nonempty(bind_writers))
1360+
torture_sched_setaffinity(writer_tasks[i]->pid, bind_writers);
13611361

13621362
create_reader:
13631363
if (cxt.cur_ops->readlock == NULL || (j >= cxt.nrealreaders_stress))
@@ -1367,8 +1367,8 @@ static int __init lock_torture_init(void)
13671367
reader_tasks[j]);
13681368
if (torture_init_error(firsterr))
13691369
goto unwind;
1370-
if (cpumask_nonempty(readers_bind))
1371-
torture_sched_setaffinity(reader_tasks[j]->pid, readers_bind);
1370+
if (cpumask_nonempty(bind_readers))
1371+
torture_sched_setaffinity(reader_tasks[j]->pid, bind_readers);
13721372
}
13731373
if (stat_interval > 0) {
13741374
firsterr = torture_create_kthread(lock_torture_stats, NULL,

0 commit comments

Comments
 (0)