Re: [PATCH v4] sched: Consolidate cpufreq updates

From: Qais Yousef
Date: Tue May 28 2024 - 21:11:57 EST


On 05/17/24 12:06, Hongyan Xia wrote:

> > @@ -1997,6 +1999,13 @@ static void __setscheduler_uclamp(struct task_struct *p,
> > uclamp_se_set(&p->uclamp_req[UCLAMP_MAX],
> > attr->sched_util_max, true);
> > }
> > +
> > + /*
> > + * Updating uclamp values has impact on freq, ensure it is taken into
> > + * account.
> > + */
> > + if (task_current(rq, p))
> > + update_cpufreq_ctx_switch(rq, NULL);
>
> Do we care about updating the frequency here? p is dequeued during the
> __setscheduler_uclamp() call, so I think it's better to do this after the
> uclamp() call and after enqueue_task(), so that uclamp_rq_inc() comes into
> effect.

Yes!

> Also, do we want to limit the update to task_current()?

Yes we only care about current because it is running and asking to run faster
so we should honour this immediately.

With this patch we don't do freq updates at enqueue anyway.


Thanks!

--
Qais Yousef