Skip to content

Commit e9d338a

Browse files
committed
scftorture: Add smp_call_function() torture test
This commit adds an smp_call_function() torture test that repeatedly invokes this function and complains if things go badly awry. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 9123e3a commit e9d338a

4 files changed

Lines changed: 454 additions & 0 deletions

File tree

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4637,6 +4637,98 @@
46374637
Format: integer between 0 and 10
46384638
Default is 0.
46394639

4640+
scftorture.holdoff= [KNL]
4641+
Number of seconds to hold off before starting
4642+
test. Defaults to zero for module insertion and
4643+
to 10 seconds for built-in smp_call_function()
4644+
tests.
4645+
4646+
scftorture.longwait= [KNL]
4647+
Request ridiculously long waits randomly selected
4648+
up to the chosen limit in seconds. Zero (the
4649+
default) disables this feature. Please note
4650+
that requesting even small non-zero numbers of
4651+
seconds can result in RCU CPU stall warnings,
4652+
softlockup complaints, and so on.
4653+
4654+
scftorture.nthreads= [KNL]
4655+
Number of kthreads to spawn to invoke the
4656+
smp_call_function() family of functions.
4657+
The default of -1 specifies a number of kthreads
4658+
equal to the number of CPUs.
4659+
4660+
scftorture.onoff_holdoff= [KNL]
4661+
Number seconds to wait after the start of the
4662+
test before initiating CPU-hotplug operations.
4663+
4664+
scftorture.onoff_interval= [KNL]
4665+
Number seconds to wait between successive
4666+
CPU-hotplug operations. Specifying zero (which
4667+
is the default) disables CPU-hotplug operations.
4668+
4669+
scftorture.shutdown_secs= [KNL]
4670+
The number of seconds following the start of the
4671+
test after which to shut down the system. The
4672+
default of zero avoids shutting down the system.
4673+
Non-zero values are useful for automated tests.
4674+
4675+
scftorture.stat_interval= [KNL]
4676+
The number of seconds between outputting the
4677+
current test statistics to the console. A value
4678+
of zero disables statistics output.
4679+
4680+
scftorture.stutter_cpus= [KNL]
4681+
The number of jiffies to wait between each change
4682+
to the set of CPUs under test.
4683+
4684+
scftorture.use_cpus_read_lock= [KNL]
4685+
Use use_cpus_read_lock() instead of the default
4686+
preempt_disable() to disable CPU hotplug
4687+
while invoking one of the smp_call_function*()
4688+
functions.
4689+
4690+
scftorture.verbose= [KNL]
4691+
Enable additional printk() statements.
4692+
4693+
scftorture.weight_single= [KNL]
4694+
The probability weighting to use for the
4695+
smp_call_function_single() function with a zero
4696+
"wait" parameter. A value of -1 selects the
4697+
default if all other weights are -1. However,
4698+
if at least one weight has some other value, a
4699+
value of -1 will instead select a weight of zero.
4700+
4701+
scftorture.weight_single_wait= [KNL]
4702+
The probability weighting to use for the
4703+
smp_call_function_single() function with a
4704+
non-zero "wait" parameter. See weight_single.
4705+
4706+
scftorture.weight_many= [KNL]
4707+
The probability weighting to use for the
4708+
smp_call_function_many() function with a zero
4709+
"wait" parameter. See weight_single.
4710+
Note well that setting a high probability for
4711+
this weighting can place serious IPI load
4712+
on the system.
4713+
4714+
scftorture.weight_many_wait= [KNL]
4715+
The probability weighting to use for the
4716+
smp_call_function_many() function with a
4717+
non-zero "wait" parameter. See weight_single
4718+
and weight_many.
4719+
4720+
scftorture.weight_all= [KNL]
4721+
The probability weighting to use for the
4722+
smp_call_function_all() function with a zero
4723+
"wait" parameter. See weight_single and
4724+
weight_many.
4725+
4726+
scftorture.weight_all_wait= [KNL]
4727+
The probability weighting to use for the
4728+
smp_call_function_all() function with a
4729+
non-zero "wait" parameter. See weight_single
4730+
and weight_many.
4731+
46404732
skew_tick= [KNL] Offset the periodic timer tick per cpu to mitigate
46414733
xtime_lock contention on larger systems, and/or RCU lock
46424734
contention on all systems with CONFIG_MAXSMP set.

kernel/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ KASAN_SANITIZE_stackleak.o := n
133133
KCSAN_SANITIZE_stackleak.o := n
134134
KCOV_INSTRUMENT_stackleak.o := n
135135

136+
obj-$(CONFIG_SCF_TORTURE_TEST) += scftorture.o
137+
136138
$(obj)/configs.o: $(obj)/config_data.gz
137139

138140
targets += config_data.gz

0 commit comments

Comments
 (0)