Skip to content

Commit a59ee76

Browse files
committed
torture: Forgive -EBUSY from boottime CPU-hotplug operations
During boot, CPU hotplug is often disabled, for example by PCI probing. On large systems that take substantial time to boot, this can result in spurious RCU_HOTPLUG errors. This commit therefore forgives any boottime -EBUSY CPU-hotplug failures by adjusting counters to pretend that the corresponding attempt never happened. A non-splat record of the failed attempt is emitted to the console with the added string "(-EBUSY forgiven during boot)". Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 4355080 commit a59ee76

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

kernel/torture.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ bool torture_offline(int cpu, long *n_offl_attempts, long *n_offl_successes,
8484
{
8585
unsigned long delta;
8686
int ret;
87+
char *s;
8788
unsigned long starttime;
8889

8990
if (!cpu_online(cpu) || !cpu_is_hotpluggable(cpu))
@@ -99,10 +100,16 @@ bool torture_offline(int cpu, long *n_offl_attempts, long *n_offl_successes,
99100
(*n_offl_attempts)++;
100101
ret = cpu_down(cpu);
101102
if (ret) {
103+
s = "";
104+
if (!rcu_inkernel_boot_has_ended() && ret == -EBUSY) {
105+
// PCI probe frequently disables hotplug during boot.
106+
(*n_offl_attempts)--;
107+
s = " (-EBUSY forgiven during boot)";
108+
}
102109
if (verbose)
103110
pr_alert("%s" TORTURE_FLAG
104-
"torture_onoff task: offline %d failed: errno %d\n",
105-
torture_type, cpu, ret);
111+
"torture_onoff task: offline %d failed%s: errno %d\n",
112+
torture_type, cpu, s, ret);
106113
} else {
107114
if (verbose > 1)
108115
pr_alert("%s" TORTURE_FLAG
@@ -137,6 +144,7 @@ bool torture_online(int cpu, long *n_onl_attempts, long *n_onl_successes,
137144
{
138145
unsigned long delta;
139146
int ret;
147+
char *s;
140148
unsigned long starttime;
141149

142150
if (cpu_online(cpu) || !cpu_is_hotpluggable(cpu))
@@ -150,10 +158,16 @@ bool torture_online(int cpu, long *n_onl_attempts, long *n_onl_successes,
150158
(*n_onl_attempts)++;
151159
ret = cpu_up(cpu);
152160
if (ret) {
161+
s = "";
162+
if (!rcu_inkernel_boot_has_ended() && ret == -EBUSY) {
163+
// PCI probe frequently disables hotplug during boot.
164+
(*n_onl_attempts)--;
165+
s = " (-EBUSY forgiven during boot)";
166+
}
153167
if (verbose)
154168
pr_alert("%s" TORTURE_FLAG
155-
"torture_onoff task: online %d failed: errno %d\n",
156-
torture_type, cpu, ret);
169+
"torture_onoff task: online %d failed%s: errno %d\n",
170+
torture_type, cpu, s, ret);
157171
} else {
158172
if (verbose > 1)
159173
pr_alert("%s" TORTURE_FLAG

0 commit comments

Comments
 (0)