sched: panic() in schedule_bug

From: Kathleen Chang
Date: Fri Dec 07 2018 - 05:00:28 EST


hi,

[kernel-4.9, kernel-4.14]


When preemption disable in schedule(),
Current linux design will panic when panic_on_warn=1

However,
default setting, panic_on_warn=0, and
if panic_on_warn=1 , and call panic() after printing out WARN()
location. It affects too much cases.

Could panic directly without checking panic_on_warn?
This is obviously incorrect behavior, and should be panic to prevent
misbehavior.


if (panic_on_warn)
panic("scheduling while atomic\n");


thanks!


=============================
kernel/sched/core.c

schedule_debug => when in atomic preempt off => __schedule_bug

====