Re: [PATCH v2 2/2] sched_ext: Add cpuperf support
From: Vincent Guittot
Date: Sat Jul 06 2024 - 05:01:41 EST
On Fri, 5 Jul 2024 at 20:22, Tejun Heo <tj@xxxxxxxxxx> wrote:
>
> Hello, Vincent.
>
> On Fri, Jul 05, 2024 at 02:41:41PM +0200, Vincent Guittot wrote:
> > > static void sugov_get_util(struct sugov_cpu *sg_cpu, unsigned long boost)
> > > {
> > > - unsigned long min, max, util = cpu_util_cfs_boost(sg_cpu->cpu);
> > > + unsigned long min, max, util = scx_cpuperf_target(sg_cpu->cpu);
> > >
> > > + if (!scx_switched_all())
> > > + util += cpu_util_cfs_boost(sg_cpu->cpu);
> >
> > I don't see the need for this. If fair is not used, this returns zero
>
> There's scx_enabled() and scx_switched_all(). The former is set when some
> tasks may be on sched_ext. The latter when all tasks are on sched_ext. When
> some tasks may be on sched_ext but other tasks may be on fair, the condition
> is scx_enabled() && !scx_switched_all(). So, the above if statement
> condition is true for all cases that tasks may be on CFS (sched_ext is
> disabled or is enabled in partial mode).
My point is that if there is no fair task, cpu_util_cfs_boost() will
already return 0 so there is no need to add a sched_ext if statement
there
Vincent
>
> Thanks.
>
> --
> tejun