public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Juri Lelli <juri.lelli@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	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>
Subject: Re: [PATCH] sched/deadline: Fix BUG_ON condition for deboosted tasks
Date: Wed, 13 Jul 2022 13:46:11 +0200	[thread overview]
Message-ID: <Ys6wgxiZbdjxyh8C@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20220713075014.411739-1-juri.lelli@redhat.com>

On Wed, Jul 13, 2022 at 09:50:14AM +0200, 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")
> Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
> ---
>  kernel/sched/deadline.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 5867e186c39a..0447d46f4718 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -1703,7 +1703,7 @@ static void enqueue_task_dl(struct rq *rq, struct task_struct *p, int flags)
>  		 * the throttle.
>  		 */
>  		p->dl.dl_throttled = 0;
> -		BUG_ON(!is_dl_boosted(&p->dl) || flags != ENQUEUE_REPLENISH);
> +		BUG_ON(!(flags & ENQUEUE_REPLENISH));

While there, can we perhaps make it less fatal? 

  reply	other threads:[~2022-07-13 11:46 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 [this message]
2022-07-13 12:58   ` Juri Lelli
2022-07-13 21:31 ` Srivatsa S. Bhat
2022-07-14  7:28   ` Juri Lelli
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=Ys6wgxiZbdjxyh8C@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --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