Re: [PATCH v2 2/2] sched_ext: Add cpuperf support

From: Tejun Heo
Date: Fri Jul 05 2024 - 14:23:00 EST


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).

Thanks.

--
tejun