Re: [RFC PATCH v3 05/10] sched/topology: Reference the Energy Model of CPUs when available

From: Quentin Perret
Date: Wed Jun 20 2018 - 04:36:40 EST


On Tuesday 19 Jun 2018 at 20:42:50 (+0200), Peter Zijlstra wrote:
> On Tue, Jun 19, 2018 at 06:13:17PM +0100, Quentin Perret wrote:
> > Would replacing the static_key by a flag attached to the root_domain be
> > reasonable ?
>
> Keep the static key as is, enable if any root domain needs it.

OK. So basically the semantics of the static key becomes: it is set if
at least one root domain has a non-empty list of freq domains. And a
root_domain has a non-empty list of frequency domains if it meets all
conditions for EAS (SD_ASYM_CPUCAPACITY flag set, low complexity for
the "portion" of the EM covering it, ...)

And then, checking the status of the list (empty or not) for a specific
root domain can replace my flag I guess. I'll need to check that somewhere
around select_task_rq_fair() in addition to the check on the static key to
decide if a task can go in find_energy_efficient_cpu().

> > Sorry but I didn't understand that ...
>
> If you have only a single freq-domain, there is nothing to do, right?

Ah, right. Since we already agreed that all CPUs in a freq domain must
have the same micro-arch, that's correct. Checking the presence of the
SD_ASYM_CPUCAPACITY flag should cover this case I guess.

Thanks,
Quentin