Skip to content

Commit 8171d3e

Browse files
committed
torture: Allow disabling of boottime CPU-hotplug torture operations
In theory, RCU-hotplug operations are supposed to work as soon as there is more than one CPU online. However, in practice, in normal production there is no way to make them happen until userspace is up and running. Besides which, on smaller systems, rcutorture doesn't start doing hotplug operations until 30 seconds after the start of boot, which on most systems also means the better part of 30 seconds after the end of boot. This commit therefore provides a new torture.disable_onoff_at_boot kernel boot parameter that suppresses CPU-hotplug torture operations until about the time that init is spawned. Of course, if you know of a need for boottime CPU-hotplug operations, then you should avoid passing this argument to any of the torture tests. You might also want to look at the splats linked to below. Link: https://lore.kernel.org/lkml/20191206185208.GA25636@paulmck-ThinkPad-P72/ Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 4ab00bd commit 8171d3e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4873,6 +4873,10 @@
48734873
topology updates sent by the hypervisor to this
48744874
LPAR.
48754875

4876+
torture.disable_onoff_at_boot= [KNL]
4877+
Prevent the CPU-hotplug component of torturing
4878+
until after init has spawned.
4879+
48764880
tp720= [HW,PS2]
48774881

48784882
tpm_suspend_pcr=[HW,TPM]

kernel/torture.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
MODULE_LICENSE("GPL");
4343
MODULE_AUTHOR("Paul E. McKenney <[email protected]>");
4444

45+
static bool disable_onoff_at_boot;
46+
module_param(disable_onoff_at_boot, bool, 0444);
47+
4548
static char *torture_type;
4649
static int verbose;
4750

@@ -229,6 +232,10 @@ torture_onoff(void *arg)
229232
VERBOSE_TOROUT_STRING("torture_onoff end holdoff");
230233
}
231234
while (!torture_must_stop()) {
235+
if (disable_onoff_at_boot && !rcu_inkernel_boot_has_ended()) {
236+
schedule_timeout_interruptible(HZ / 10);
237+
continue;
238+
}
232239
cpu = (torture_random(&rand) >> 4) % (maxcpu + 1);
233240
if (!torture_offline(cpu,
234241
&n_offline_attempts, &n_offline_successes,

0 commit comments

Comments
 (0)