Re: [PATCH v5 4/4] sched/uclamp: Move uclamp_rq_{inc, dec}() from core.c

From: Qais Yousef

Date: Mon Nov 02 2026 - 20:35:52 EST


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.