Skip to content

Commit 5ff7c9f

Browse files
walacpaulmckrcu
authored andcommitted
rcutorture: Avoid soft lockup during cpu stall
If we use the module stall_cpu option, we may get a soft lockup warning in case we also don't pass the stall_cpu_block option. Introduce the stall_no_softlockup option to avoid a soft lockup on cpu stall even if we don't use the stall_cpu_block option. Signed-off-by: Wander Lairson Costa <wander@redhat.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 81faa4f commit 5ff7c9f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

kernel/rcu/rcutorture.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include <linux/oom.h>
4747
#include <linux/tick.h>
4848
#include <linux/rcupdate_trace.h>
49+
#include <linux/nmi.h>
4950

5051
#include "rcu.h"
5152

@@ -112,6 +113,8 @@ torture_param(int, shutdown_secs, 0, "Shutdown time (s), <= zero to disable.");
112113
torture_param(int, stall_cpu, 0, "Stall duration (s), zero to disable.");
113114
torture_param(int, stall_cpu_holdoff, 10,
114115
"Time to wait before starting stall (s).");
116+
torture_param(bool, stall_no_softlockup, false,
117+
"Avoid softlockup warning during cpu stall.");
115118
torture_param(int, stall_cpu_irqsoff, 0, "Disable interrupts while stalling.");
116119
torture_param(int, stall_cpu_block, 0, "Sleep while stalling.");
117120
torture_param(int, stall_gp_kthread, 0,
@@ -2085,6 +2088,8 @@ static int rcu_torture_stall(void *args)
20852088
#else
20862089
schedule_timeout_uninterruptible(HZ);
20872090
#endif
2091+
} else if (stall_no_softlockup) {
2092+
touch_softlockup_watchdog();
20882093
}
20892094
if (stall_cpu_irqsoff)
20902095
local_irq_enable();

0 commit comments

Comments
 (0)