lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 16 Oct 2020 13:48:33 +0200
From:   Daniel Lezcano <daniel.lezcano@...aro.org>
To:     "Rafael J. Wysocki" <rafael@...nel.org>
Cc:     Lukasz Luba <lukasz.luba@....com>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        "open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Amit Kucheria <amitk@...nel.org>,
        Jonathan Corbet <corbet@....net>,
        Dietmar Eggemann <Dietmar.Eggemann@....com>,
        Quentin Perret <qperret@...gle.com>,
        Doug Anderson <dianders@...omium.org>,
        Matthias Kaehlcke <mka@...omium.org>,
        "Nayak, Rajendra" <rnayak@...eaurora.org>
Subject: Re: [PATCH v2 0/3] Clarify abstract scale usage for power values in
 Energy Model, EAS and IPA

On 15/10/2020 15:40, Rafael J. Wysocki wrote:
> On Thu, Oct 15, 2020 at 12:22 PM Daniel Lezcano
> <daniel.lezcano@...aro.org> wrote:

[ ... ]

>>> We would allow to co-exist em_dev_register_perf_domain(..., false)
>>> with dev_pm_opp_of_register_em() EM devices.
>>>
>>> Is it make sense?
>>
>> Well, it does not change my opinion. We should assume the energy model
>> is always milliwatts. If the SoC vendors find a way to get around with
>> bogoWatts, then good to them and up to them to deal with in the future.
> 
> That sounds fair enough, but it also means that any kernel patches
> using power units different from milliwatts for the EM should be
> rejected in the future, doesn't it?

Actually there are two things: the units and the numbers.

The energy model is expressed in mW.

All the frameworks (EAS, IPA, hopefully DTPM) using the energy model
should stick to the same unit, which I believe makes sense.

The numbers are provided by the SoC vendor or any contributors [1][2].

The different frameworks depends on those numbers.

If we specify in the documentation we support abstract numbers for the
EM, then that will imply any framework using it will have to comply with
that.

My point is we use milliwatts as a reference.

If we want to support abstract values, then the code should be changed
by *explicitly* use with these values, so if the other frameworks are
expecting real watts, they can detect they are not available and take
another action, like the scmi scaled power numbers and the
sustainable-power of the thermal which are incompatible.

If the consistency across the frameworks is guarantee by identifying the
kind of values (abstract or real), then we can put in the documentation
we support abstract value.

Unfortunately, IIUC, scmi does not tell us if the power numbers are real
or abstract ... :/

I don't see how we can ensure a consistency across the framework without
enforcing a strong policy.

> And the existing code using different power units for the EM (if any)
> should be updated/fixed accordingly, shouldn't it?

Currently, the power units are expressed in mwatts for the energy model
and the frameworks using it.  AFAICT, no change is needed if we keep mW.

If we use scaled numbers, the EAS will work correctly (but the energy
values will be incorrect), but other frameworks won't.

The power numbers are provided by the DT (as supposed real), or by SCMI
(real or abstract).

If the SCMI is returning abstract numbers, the thermal IPA governor will
use these numbers as a reference to mitigate the temperature at the
specified sustainable power which is expressed in mW in the DT. So it
does not work and we can not detect such conflict.

That is why I'm advocating to keep mW for the energy model and make the
SCMI and DT power numbers incompatible.

  -- Daniel


[1]
https://patchwork.kernel.org/project/linux-arm-kernel/patch/1500974575-2244-1-git-send-email-wxt@rock-chips.com/

[2]
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20190604165802.7338-2-daniel.lezcano@linaro.org/#22686211

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ