From: Juri Lelli <juri.lelli@redhat.com>
To: "Srivatsa S. Bhat" <srivatsa@csail.mit.edu>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-rt-users <linux-rt-users@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Valentin Schneider <vschneid@redhat.com>,
Sharan Turlapati <sturlapati@vmware.com>,
bordoloih@vmware.com, ankitja@vmware.com,
Keerthana K <keerthanak@vmware.com>,
Anish Swaminathan <anishs@vmware.com>,
Srivatsa Bhat <srivatsab@vmware.com>
Subject: Re: [PATCH] sched/deadline: Fix BUG_ON condition for deboosted tasks
Date: Thu, 14 Jul 2022 09:28:08 +0200 [thread overview]
Message-ID: <Ys/FiJ3tgc0CYDcu@localhost.localdomain> (raw)
In-Reply-To: <806a86d3-5204-145e-af46-023bf0142aa8@csail.mit.edu>
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
next prev parent reply other threads:[~2022-07-14 7:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 7:50 [PATCH] sched/deadline: Fix BUG_ON condition for deboosted tasks Juri Lelli
2022-07-13 11:46 ` Peter Zijlstra
2022-07-13 12:58 ` Juri Lelli
2022-07-13 21:31 ` Srivatsa S. Bhat
2022-07-14 7:28 ` Juri Lelli [this message]
2022-07-15 4:49 ` Ankit Jain
2022-07-15 7:47 ` Juri Lelli
2022-07-18 7:46 ` Ankit Jain
2022-07-18 13:01 ` Juri Lelli
2022-07-19 5:30 ` Ankit Jain
2022-07-19 7:19 ` Juri Lelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ys/FiJ3tgc0CYDcu@localhost.localdomain \
--to=juri.lelli@redhat.com \
--cc=anishs@vmware.com \
--cc=ankitja@vmware.com \
--cc=bordoloih@vmware.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=keerthanak@vmware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=srivatsa@csail.mit.edu \
--cc=srivatsab@vmware.com \
--cc=sturlapati@vmware.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox