All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Juri Lelli <juri.lelli@redhat.com>
Cc: 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>,
	Valentin Schneider <vschneid@redhat.com>,
	Philip Auld <pauld@redhat.com>,
	Gabriele Monaco <gmonaco@redhat.com>,
	linux-kernel@vger.kernel.org,
	Bruno Goncalves <bgoncalv@redhat.com>
Subject: Re: [PATCH] sched/deadline: Fix missing ENQUEUE_REPLENISH during PI de-boosting
Date: Tue, 24 Feb 2026 14:45:52 +0100	[thread overview]
Message-ID: <20260224134552.GA596554@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <aYms6mIxWl0FNqBF@jlelli-thinkpadt14gen4.remote.csb>

On Mon, Feb 09, 2026 at 10:46:18AM +0100, Juri Lelli wrote:

> > (afaict nothing clears dl_se::pi_se except rt_mutex_setprio() so that
> > should still be valid here -- so we don't need to go find it again)
> 
> But, maybe with something like this? I believe we need to make things
> right at this point "promoting" the now becoming lower prio class task
> to DEADLINE (inheriting from the task it didn't inherit from in the
> past). Maybe we can avoid checking pi_task since dl_prio(newprio). And
> also move everything in an helper to remove ifdeffery.
> 
> ---
> diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c
> index 6f10db3646e7f..856df1a22e3ca 100644
> --- a/kernel/sched/syscalls.c
> +++ b/kernel/sched/syscalls.c
> @@ -655,6 +655,16 @@ int __sched_setscheduler(struct task_struct *p,
>  			__setscheduler_params(p, attr);
>  			p->sched_class = next_class;
>  			p->prio = newprio;
> +#ifdef CONFIG_RT_MUTEXES
> +			if (dl_prio(newprio) && !dl_policy(policy)) {
> +				struct task_struct *pi_task = rt_mutex_get_top_task(p);
> +
> +				if (pi_task) {
> +					p->dl.pi_se = pi_task->dl.pi_se;
> +					scope->flags |= ENQUEUE_REPLENISH;
> +				}
> +			}
> +#endif
>  		}
>  		__setscheduler_uclamp(p, attr);

I'm still a bit confused on the pi_se thing; if this was a dl task, then
rt_mutex_setprio() would've already set this to pi_task->dl.pi_se, no?

Anyway, yes something like that, possibly with a helper sounds fine.

  parent reply	other threads:[~2026-02-24 13:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 13:25 [PATCH] sched/deadline: Fix missing ENQUEUE_REPLENISH during PI de-boosting Juri Lelli
2026-02-06 15:39 ` Peter Zijlstra
2026-02-06 15:42   ` Juri Lelli
2026-02-07  8:45 ` Peter Zijlstra
2026-02-09  9:46   ` Juri Lelli
2026-02-24 13:22     ` Juri Lelli
2026-02-24 13:45     ` Peter Zijlstra [this message]
2026-02-24 14:05       ` 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=20260224134552.GA596554@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bgoncalv@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=gmonaco@redhat.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=pauld@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.