Re: [PATCH RFC] powercap/drivers/energy_model: protocode: Add powercap energy model based

From: Daniel Lezcano
Date: Fri Sep 11 2020 - 03:58:18 EST



Hi Amit,

thanks for taking the time to review the series and read this long
description.

On 10/09/2020 11:48, Amit Kucheria wrote:

[ ... ]

>> +
>> +config POWERCAP_EM
>> + bool "Energy model based power capping"
>> + depends on ENERGY_MODEL
>> + default y
>
> Don't make it default ;-)

Thanks for pointing this out :D

[ ... ]

>> + pc_package = powercap_em_register(pct, "package", pc_soc,
>> + &zone_ops, 1, &constraint_ops);
>
> Will the soc and package hierarchy eventually be dynamically read from
> devicetree or similar and these hardcoded registration removed?

Yes, that's correct.

> For the rest of the devices, IMO, it makes sense to use the genpd
> hierarchy to reflect the powercap hierarchy. I whipped up the
> following patch to show how it might be achieved. What needs to be
> done is to now reflect the parent-child/sibling relationships of genpd
> into powercap. Initially I thought we'd need to additional DT
> properties in the genpd bindings but I think we might be able to read
> the device-specific energy model data directly to populate the
> powercap constraints.

We need a way to describe the power constraints relationship of the
domains to populate the hierarchy of the powercap directories.

In the DT it may look like that (very roughly):

power-constraints {
power-constraint: package {
compatible = "power-constraint,virtual";
};

power-constraint: perfdomain0 {
compatible = "power-constraint,cpu";
device = <&cpu_l0>;
parent = <&package>;
};

power-constraint: perfdomain1 {
compatible = "power-constraint,cpu";
device = <&cpu_b0>;
parent = <&package>;
};

power-constraint: gpu {
compatible = "power-constraint,gpu";
parent = <&package>
};
};


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog