Hi Daniel,
On 13/12/2023 17:58, Daniel Lezcano wrote:
Currently cpufreq and devfreq are using the freq QoS to aggregate the
requests for frequency ranges.
However, there are new devices wanting to act not on a frequency range
but on a performance index range. Those need also to export to
userspace the knob to act on their performance limits.
This change provides a performance limiter QoS based on a minimum /
maximum performance values. At init time, the limits of the interval
are 0 / 1024. It is up to the backend to convert the 1024 to the
maximum performance state. So if the performance must be limited to
50%, it should set to maximum limit to 512 where the backend will end
up by converting (max performance index / 2). The same applies for the
minimum. Obviously, the min can not be greater than the max.
I really feel like it should be possible to have arbitrary min/max
performance values. As is the case with latency and frequency.
1. With the example above, if there is a odd number like 5 for the
number of performance indexes and we ask for 512 (so 50%), what would
be the performance index computed? (5/2=2 or 5/2=3)? (I would say the
minimum otherwise we end up with a performance limit greater than
what we actually asked for).
For a device with just a handful of performance indices this is quite a
large margin for error. If there are just 3 for example, and some
algorithm is decreasing the performance level over time (e.g. due to
some thermal condition), the algorithm cannot determine at what point
the devices performance level has actually changed, making debugging and
tuning of behaviour needlessly difficult.
This also leaves it up to the backend driver to decide if it should
round up or down, something that should definitely be handled by the
framework.
Maybe I missed some previous discussion, but isn't this what
operating-points is designed for?
It has an `opp-level` property, but that is meant to be device-specific.
With the `opp-hz` property being the "normalised" values that the
framework deals with.
We would just want some way to defined an `opp-level` as a percentage
(or whatever), with an arbitrary `opp-performance-index` being the
device-specific property.
This also gracefully handles non-linear performance scaling.