[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ys/FiJ3tgc0CYDcu@localhost.localdomain>
Date: Thu, 14 Jul 2022 09:28:08 +0200
From: Juri Lelli <juri.lelli@...hat.com>
To: "Srivatsa S. Bhat" <srivatsa@...il.mit.edu>
Cc: LKML <linux-kernel@...r.kernel.org>,
linux-rt-users <linux-rt-users@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Valentin Schneider <vschneid@...hat.com>,
Sharan Turlapati <sturlapati@...are.com>, bordoloih@...are.com,
ankitja@...are.com, Keerthana K <keerthanak@...are.com>,
Anish Swaminathan <anishs@...are.com>,
Srivatsa Bhat <srivatsab@...are.com>
Subject: Re: [PATCH] sched/deadline: Fix BUG_ON condition for deboosted tasks
Hi,
On 13/07/22 14:31, Srivatsa S. Bhat wrote:
>
> Hi Juri,
>
> On 7/13/22 12:50 AM, Juri Lelli wrote:
> > Tasks the are being deboosted from SCHED_DEADLINE might enter
> > enqueue_task_dl() one last time and hit an erroneous BUG_ON condition:
> > since they are not boosted anymore, the if (is_dl_boosted()) branch is
> > not taken, but the else if (!dl_prio) is and inside this one we
> > BUG_ON(!is_dl_boosted), which is of course false (BUG_ON triggered)
> > otherwise we had entered the if branch above. Long story short, the
> > current condition doesn't make sense and always leads to triggering of a
> > BUG.
> >
> > Fix this by only checking enqueue flags, properly: ENQUEUE_REPLENISH has
> > to be present, but additional flags are not a problem.
> >
> > Fixes: 2279f540ea7d ("sched/deadline: Fix priority inheritance with multiple scheduling classes")
>
> It looks like this problem goes further back than the above commit
> (which was merged in v5.10).
>
> Even the oldest LTS kernel (4.9) has code like this:
>
> if (... && p->dl.dl_boosted && ...)) {
> /* code */
>
> } else if (!dl_prio(p->normal_prio)) {
>
> BUG_ON(!p->dl.dl_boosted || flags != ENQUEUE_REPLENISH);
> return;
> }
>
> And we have observed crashes in the 4.19 kernel series too (CC'ed
> Ankit Jain and Him Kalyan who have reproduced this issue).
>
> I believe commit 64be6f1f5f71 ("sched/deadline: Don't replenish from a
> !SCHED_DEADLINE entity") introduced the problem, which dates back to
> v3.18.
>
> Would you mind updating the Fixes: tag and adding a CC: stable tag as
> well, when you respin the patch, please?
I think you are right. Will do.
Thanks for taking a look!
Best,
Juri
Powered by blists - more mailing lists