Re: [PATCH v1 2/3] PM: EM: Make three functions static

From: Lukasz Luba
Date: Thu Mar 06 2025 - 05:03:01 EST


Hi Rafael,

On 3/5/25 21:11, Rafael J. Wysocki wrote:
From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>

Three functions in the Energy Model code, em_dev_update_perf_domain(),
em_table_alloc() and em_table_free(), have no users outside that code and
so make them static, remove their headers from the Energy Model header
file and remove a piece of documentation associated with them.

This also helps to clean up RCU handling in the Energy Model code that
will be done subsequently.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
---

This essentially follow the rules that all functions without users in the
files where they are defined should be static (with all due respect to any
out-of-the-tree users of them).

This change can be reversed when any new users of these functions appear,
but it will have to take changes made by the subsequent patch into account.


I see your point and it's valid.

Although, please give me a few days and I will send some patches which
add a client for this API. It will be a modification of the EM for
CPUs while the GPU is producing heat to the SoC. Then IPA and EAS
will get the updated total power values (doe to this this leakage power)
in the EM.

As of now, I had some code downstream for research, that I share with
partners in the Android world [1].
I believe the user-space sysfs (like in that top patch) which allows
such EM modification would not be accepted?
Such approach might also help the Middle-ware in the OS to influence the
kernel decisions, mainly on phones, where the app just occupies the
screen and Middle-ware knows about it.

Regards,
Lukasz

[1] https://gitlab.arm.com/linux-arm/linux-power/-/commits/dynamic_energy_model/android14-v6.1/v6.1.75/?ref_type=heads