Re: [PATCH] sched: Do not bug in __sched_setscheduler() when pi is not used

Steven Rostedt
2018-11-19T19:28:01Z

On Mon, 19 Nov 2018 11:09:50 -0800
Florian Fainelli <f.fainelli@gmail.com> wrote:

> > I did the change against v4.2.8 below.
>
> Thanks Steven! Here is the local 4.9 backport:

Yours even updates the comment.

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 917be221438b..6b3fff6a6437 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -4087,8 +4087,8 @@ static int __sched_setscheduler(struct task_struct *p,
> int queue_flags = DEQUEUE_SAVE | DEQUEUE_MOVE;
> struct rq *rq;
>
> - /* may grab non-irq protected spin_locks */
> - BUG_ON(in_interrupt());
> + /* The pi code expects interrupts enabled */
> + BUG_ON(pi && in_interrupt());
> recheck:
> /* double check policy once rq lock held */