Re: RFC: SysRq nice-all-RT-tasks is broken

From: Steven Rostedt
Date: Wed Mar 08 2017 - 11:51:29 EST


On Wed, 8 Mar 2017 16:23:35 +0100
Laurent Dufour <ldufour@xxxxxxxxxxxxxxxxxx> wrote:

> I got it on Power and on X86_64, but I guess it should happen in all
> architectures.
> Here are the steps to recreate it :
> 1. Create a RT task : sudo chrt -f 50 /bin/sleep 999999
> 2. On the console trigger the 'nice-all-RT-tasks' SYS-RQ.
>
> The panic is triggered by the BUG_ON(in_interrupt()) introduced by this
> commit:
>
> 66e5393a78b3 ("[PATCH] BUG() if setscheduler is called from interrupt
> context")
>
> Since SysRq is run from the interrupt context, the panic is expected.
>
> Looking at the code, I'm wondering if the BUG_ON() is still required in
> __sched_setscheduler(). But I'm not so confident, so requesting your
> advise here.
>

Hmm, that commit was added in 2.6.18, and you're right, a lot has
changed since then. Have you tried removing it and running it under
lockdep, and see if it triggers any warnings?

-- Steve