Commit 58c53360 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcutorture: Allow boottime stall warnings to be suppressed



In normal production, an RCU CPU stall warning at boottime is often
just as bad as at any other time.  In fact, given the desire for fast
boot, any sort of long-term stall at boot is a bad idea.  However,
heavy rcutorture testing on large hyperthreaded systems can generate
boottime RCU CPU stalls as a matter of course.  This commit therefore
provides a kernel boot parameter that suppresses reporting of boottime
RCU CPU stall warnings and similarly of rcutorture writer stalls.

Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent a59ee765
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4195,6 +4195,12 @@
	rcupdate.rcu_cpu_stall_suppress= [KNL]
			Suppress RCU CPU stall warning messages.

	rcupdate.rcu_cpu_stall_suppress_at_boot= [KNL]
			Suppress RCU CPU stall warning messages and
			rcutorture writer stall warnings that occur
			during early boot, that is, during the time
			before the init task is spawned.

	rcupdate.rcu_cpu_stall_timeout= [KNL]
			Set timeout for RCU CPU stall warning messages.

+17 −0
Original line number Diff line number Diff line
@@ -198,6 +198,13 @@ static inline void debug_rcu_head_unqueue(struct rcu_head *head)
}
#endif	/* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */

extern int rcu_cpu_stall_suppress_at_boot;

static inline bool rcu_stall_is_suppressed_at_boot(void)
{
	return rcu_cpu_stall_suppress_at_boot && !rcu_inkernel_boot_has_ended();
}

#ifdef CONFIG_RCU_STALL_COMMON

extern int rcu_cpu_stall_ftrace_dump;
@@ -205,6 +212,11 @@ extern int rcu_cpu_stall_suppress;
extern int rcu_cpu_stall_timeout;
int rcu_jiffies_till_stall_check(void);

static inline bool rcu_stall_is_suppressed(void)
{
	return rcu_stall_is_suppressed_at_boot() || rcu_cpu_stall_suppress;
}

#define rcu_ftrace_dump_stall_suppress() \
do { \
	if (!rcu_cpu_stall_suppress) \
@@ -218,6 +230,11 @@ do { \
} while (0)

#else /* #endif #ifdef CONFIG_RCU_STALL_COMMON */

static inline bool rcu_stall_is_suppressed(void)
{
	return rcu_stall_is_suppressed_at_boot();
}
#define rcu_ftrace_dump_stall_suppress()
#define rcu_ftrace_dump_stall_unsuppress()
#endif /* #ifdef CONFIG_RCU_STALL_COMMON */
+1 −1
Original line number Diff line number Diff line
@@ -1479,7 +1479,7 @@ rcu_torture_stats_print(void)
	if (cur_ops->stats)
		cur_ops->stats();
	if (rtcv_snap == rcu_torture_current_version &&
	    rcu_torture_current != NULL) {
	    rcu_torture_current != NULL && !rcu_stall_is_suppressed()) {
		int __maybe_unused flags = 0;
		unsigned long __maybe_unused gp_seq = 0;

+1 −1
Original line number Diff line number Diff line
@@ -518,7 +518,7 @@ static void synchronize_rcu_expedited_wait(void)
	for (;;) {
		if (synchronize_rcu_expedited_wait_once(jiffies_stall))
			return;
		if (rcu_cpu_stall_suppress)
		if (rcu_stall_is_suppressed())
			continue;
		panic_on_rcu_stall();
		pr_err("INFO: %s detected expedited stalls on CPUs/tasks: {",
+3 −3
Original line number Diff line number Diff line
@@ -383,7 +383,7 @@ static void print_other_cpu_stall(unsigned long gp_seq)

	/* Kick and suppress, if so configured. */
	rcu_stall_kick_kthreads();
	if (rcu_cpu_stall_suppress)
	if (rcu_stall_is_suppressed())
		return;

	/*
@@ -452,7 +452,7 @@ static void print_cpu_stall(void)

	/* Kick and suppress, if so configured. */
	rcu_stall_kick_kthreads();
	if (rcu_cpu_stall_suppress)
	if (rcu_stall_is_suppressed())
		return;

	/*
@@ -504,7 +504,7 @@ static void check_cpu_stall(struct rcu_data *rdp)
	unsigned long js;
	struct rcu_node *rnp;

	if ((rcu_cpu_stall_suppress && !rcu_kick_kthreads) ||
	if ((rcu_stall_is_suppressed() && !rcu_kick_kthreads) ||
	    !rcu_gp_in_progress())
		return;
	rcu_stall_kick_kthreads();
Loading