Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87bc2fdd authored by Matt Wagantall's avatar Matt Wagantall
Browse files

sched/debug: Add Kconfig to trigger panics on all 'BUG:' conditions



Introduce CONFIG_PANIC_ON_SCHED_BUG to trigger panics along with all
'BUG:' prints from the scheduler core, even potentially-recoverable
ones such as scheduling while atomic, sleeping from invalid context,
and detection of broken arch topologies.

Change-Id: I5d2f561614604357a2bc7900b047e53b3a0b7c6d
Signed-off-by: default avatarMatt Wagantall <mattw@codeaurora.org>
parent 35afb780
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -4335,6 +4335,9 @@ static noinline void __schedule_bug(struct task_struct *prev)
		print_ip_sym(current->preempt_disable_ip);
		pr_cont("\n");
	}
#endif
#ifdef CONFIG_PANIC_ON_SCHED_BUG
	BUG();
#endif
	dump_stack();
	add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
@@ -8320,6 +8323,9 @@ struct sched_domain *build_sched_domain(struct sched_domain_topology_level *tl,
#ifdef CONFIG_SCHED_DEBUG
			pr_err("     the %s domain not a subset of the %s domain\n",
					child->name, sd->name);
#endif
#ifdef CONFIG_PANIC_ON_SCHED_BUG
			BUG();
#endif
			/* Fixup, ensure @sd has at least @child cpus. */
			cpumask_or(sched_domain_span(sd),
@@ -8978,6 +8984,9 @@ void __might_sleep(const char *file, int line, int preempt_offset)
		print_ip_sym(current->preempt_disable_ip);
		pr_cont("\n");
	}
#endif
#ifdef CONFIG_PANIC_ON_SCHED_BUG
	BUG();
#endif
	dump_stack();
}
+10 −0
Original line number Diff line number Diff line
@@ -858,6 +858,16 @@ config SCHED_DEBUG
	  that can help debug the scheduler. The runtime overhead of this
	  option is minimal.

config PANIC_ON_SCHED_BUG
	bool "Panic on all bugs encountered by the scheduler"
	help
	  Say Y here to panic on all 'BUG:' conditions encountered by the
	  scheduler, even potentially-recoverable ones such as scheduling
	  while atomic, sleeping from invalid context, and detection of
	  broken arch topologies.

	  Say N if unsure.

config PANIC_ON_RT_THROTTLING
	bool "Panic on RT throttling"
	help