Re: [PATCH 1/2] thermal: power allocator: change the 'k_i' coefficient estimation

From: Daniel Lezcano
Date: Tue Oct 13 2020 - 11:56:41 EST


On 13/10/2020 14:04, Lukasz Luba wrote:
>
>
> On 10/13/20 12:22 PM, Daniel Lezcano wrote:
>> On 13/10/2020 12:59, Lukasz Luba wrote:
>>> Hi Daniel,
>>>
>>> On 10/13/20 11:21 AM, Daniel Lezcano wrote:
>>>>
>>>> Hi Lukasz,
>>>>
>>>> On 02/10/2020 14:24, Lukasz Luba wrote:
>>>>> Intelligent Power Allocation (IPA) is built around the PID controller
>>>>> concept. The initialization code tries to setup the environment
>>>>> based on
>>>>> the information available in DT or estimate the value based on minimum
>>>>> power reported by each of the cooling device. The estimation will
>>>>> have an
>>>>> impact on the PID controller behaviour via the related 'k_po', 'k_pu',
>>>>> 'k_i' coefficients and also on the power budget calculation.
>>>>>
>>>>> This change prevents the situation when 'k_i' is relatively big
>>>>> compared
>>>>> to 'k_po' and 'k_pu' values. This might happen when the estimation for
>>>>> 'sustainable_power' returned small value, thus 'k_po' and 'k_pu' are
>>>>> small.
>>>>>
>>>>> Signed-off-by: Lukasz Luba <lukasz.luba@xxxxxxx>
>>>>> ---

[ ... ]

>>> Yes, I strongly believe that vendor engineers will make experiments with
>>> these values and not go with default. Then they will store the k_pu,
>>> k_po, k_i via sysfs interface, with also sustainable_power.
>>
>> IMHO it is the opposite. For what I've seen, the IPA is not used or the
>> k_* are misunderstood, thus not changed. The PID regulation loop
>> technique is not quite used and known by everyone.
>
> There is quite a few DT entries of 'sustainable-power' so I assumed
> it is known, but you might be right.

Yes, and if you do not count the Linaro contributions, there are even
less entries.

That may imply the sustainable power is estimated in most of the case if
the vendors are specifying the ipa governor. This series may change the
default behavior, but I guess this is not a problem without the right
k_* in any case.

>>> But I have to also fix the hard-coded k_i in the estimation. As
>>> described above, when we have small power values from abstract scale,
>>> the k_i stays too big.
>>
>> May be it is preferable to adjust the k_* dynamically given the
>> undershot and overshot results? And then add a set of less opaque
>> parameters for the user, like the time or watts, no?
>>
>
> Hmmmm, this is interesting, I haven't thought about it. Thank you
> for this idea.
> That would require a re-design of current IPA. IPA trying to figure
> out better k_* values... I will discuss it internally.

[ ... ]

> It would take time, definitely more than the proposed small fix
> addressing abstract scale and hard-coded 'k_i'.
> Do you think that this fix can be applied and then I can experiment
> on what you suggested?

Yes, sure. Let me review the patch 2/2.

Thanks

-- Daniel



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