Re: [RFC PATCH 2/2] sched: sysctl: Panic on scheduling while atomic

From: Peter Zijlstra
Date: Wed Jun 01 2016 - 05:45:55 EST


On Tue, May 31, 2016 at 04:07:33PM -0300, Daniel Bristot de Oliveira wrote:
> Currently, a schedule while atomic error prints the stack trace to the
> kernel log and the system continue running.
>
> Although it is possible to collect the kernel log messages and analyse
> it, often more information are needed. Furthermore, keep the system
> running is not always the best choice. For example, when the preempt
> count underflows the system will not stop to complain about scheduling
> while atomic, so the kernel log can wraparound overwriting the first
> stack trace, tuning the analysis even more difficult.
>
> This patch implements the kernel.panic_on_sched_in_atomic sysctl to
> help out on these more complex situations.
>
> When kernel.panic_on_sched_in_atomic is set to 1, the kernel will
> panic() in the schedule while atomic detection.

Do we really need more panic_on_* knobs? Can't we re-purpose
panic_on_warn for this?