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

Commit 1ff44895 authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

sched: Introduce PANIC_ON_SCHED_BUG



Introduce PANIC_ON_SCHED_BUG to catch issues related to scheduler
like calling sleepable functions inside atomic context etc.

Change-Id: I9f1fe96772b317b17bd0e7423a48023d3cf141c7
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent b2170bd2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3407,6 +3407,9 @@ static noinline void __schedule_bug(struct task_struct *prev)
	if (panic_on_warn)
		panic("scheduling while atomic\n");

#ifdef CONFIG_PANIC_ON_SCHED_BUG
	BUG();
#endif
	dump_stack();
	add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
}
@@ -6595,6 +6598,9 @@ void ___might_sleep(const char *file, int line, int preempt_offset)
		print_ip_sym(preempt_disable_ip);
		pr_cont("\n");
	}
#ifdef CONFIG_PANIC_ON_SCHED_BUG
	BUG();
#endif
	dump_stack();
	add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
}
+10 −0
Original line number Diff line number Diff line
@@ -1000,6 +1000,16 @@ config SCHED_INFO
	bool
	default n

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 SCHEDSTATS
	bool "Collect scheduler statistics"
	depends on DEBUG_KERNEL && PROC_FS