mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qais Yousef <qyousef@layalina.io>
To: Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>
Cc: Christian Loehle <christian.loehle@arm.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Stultz <jstultz@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 4/4] sched/uclamp: Move uclamp_rq_{inc, dec}() from core.c
Date: Tue, 3 Nov 2026 01:35:05 +0000	[thread overview]
Message-ID: <37a6df6f-7f25-4acf-a253-d00a40bc796a@layalina.io> (raw)
In-Reply-To: <20261103005953.56271-5-qyousef@layalina.io>

On 11/3/26 00:59, Qais Yousef wrote:

> @@ -2188,11 +2173,10 @@ void enqueue_task(struct rq *rq, struct task_struct *p, int flags)
>  		update_rq_clock(rq);
>  
>  	/*
> -	 * Can be before ->enqueue_task() because uclamp considers the
> -	 * ENQUEUE_DELAYED task before its ->sched_delayed gets cleared
> -	 * in ->enqueue_task().
> +	 * Need to be careful what operations are done here, some classes like
> +	 * fair and RT can enqueue tasks without going through core due to some
> +	 * features like throttling.
>  	 */
> -	uclamp_rq_inc(rq, p, flags);
>  
>  	p->sched_class->enqueue_task(rq, p, flags);
>  
> @@ -2222,10 +2206,11 @@ inline bool dequeue_task(struct rq *rq, struct task_struct *p, int flags)
>  	psi_dequeue(p, flags);
>  
>  	/*
> -	 * Must be before ->dequeue_task() because ->dequeue_task() can 'fail'
> -	 * and mark the task ->sched_delayed.
> +	 * Need to be careful what operations are done here, some classes like
> +	 * fair and RT can dequeue tasks without going through core due to some
> +	 * features like throttling.
>  	 */
> -	uclamp_rq_dec(rq, p);
> +
>  	return p->sched_class->dequeue_task(rq, p, flags);
>  }
psi_enqueue/dequeue() are done at core, not sure how much an impact this has on
it due to throttling dequeueing/enqueueing without going via core and missing
these updates.

      reply	other threads:[~2026-11-03  1:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  0:59 [PATCH v5 0/4] Fix uclamp race against non atomic static key enable Qais Yousef
2026-11-03  0:59 ` [PATCH v5 1/4] sched/uclamp: Fix race condition leading to imbalanced uclamp_rq Qais Yousef
2026-11-03  0:59 ` [PATCH v5 2/4] sched/uclamp: Use wrappers instead of open coding UCLAMP_FLAG_IDLE Qais Yousef
2026-11-03  0:59 ` [PATCH RFC v5 3/4] Revert "sched/rt: Substract number of tasks of throttled queues from rq->nr_running" Qais Yousef
2026-11-03  0:59 ` [PATCH v5 4/4] sched/uclamp: Move uclamp_rq_{inc, dec}() from core.c Qais Yousef
2026-11-03  1:35   ` Qais Yousef [this message]

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=37a6df6f-7f25-4acf-a253-d00a40bc796a@layalina.io \
    --to=qyousef@layalina.io \
    --cc=christian.loehle@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    /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

all inboxes | Powered by JetHome®