Re: [PATCH 1/1] sched: Add tunable capacity margin for fis_capacity

From: Qais Yousef
Date: Fri Jun 18 2021 - 13:14:59 EST


Hi YT Chang

Thanks for the patch.

On 06/16/21 23:05, YT Chang wrote:
> Currently, the margin of cpu frequency raising and cpu overutilized are
> hard-coded as 25% (1280/1024). Make the margin tunable

The way I see cpu overutilized is that we check if we're above the 80% range.

> to control the aggressive for placement and frequency control. Such as
> for power tuning framework could adjust smaller margin to slow down
> frequency raising speed and let task stay in smaller cpu.
>
> For light loading scenarios, like beach buggy blitz and messaging apps,
> the app threads are moved big core with 25% margin and causing
> unnecessary power.
> With 0% capacity margin (1024/1024), the app threads could be kept in
> little core and deliver better power results without any fps drop.
>
> capacity margin 0% 10% 20% 30%
> current current current current
> Fps (mA) Fps (mA) Fps (mA) Fps (mA)
> Beach buggy blitz 60 198.164 60 203.211 60 209.984 60 213.374
> Yahoo browser 60 232.301 59.97 237.52 59.95 248.213 60 262.809
>
> Change-Id: Iba48c556ed1b73c9a2699e9e809bc7d9333dc004
> Signed-off-by: YT Chang <yt.chang@xxxxxxxxxxxx>
> ---

We are aware of the cpu overutilized value not being adequate on some modern
platforms. But I haven't considered or seen any issues with the frequency one.
So the latter is an interesting one.

I like your patch, but sadly I can't agree with it too.

The dilemma is that there are several options forward based on what we've seen
vendors do/want:

1. Modify the margin to be small for high end SoC and larger for lower
end ones. Which is what your patch allows.
2. Some vendors have a per cluster (perf domain) value. So within the
same SoC different margins are used for each capacity level.
3. Some vendors have asymmetric margin. A margin to move up and a
different margin to go down.

We're still not sure which approach is the best way forward.

Your patch allows 1, but if it turned out options 2 or 3 are better; the ABI
will make it hard to change.

Have you considered all these options? Do you have any data to help support
1 is enough for the range of platforms you work with at least?

We were considering also whether we can have a smarter logic to automagically
set a better value for the platform, but no concrete suggestions yet.

So while I agree the current margin value of one size fits all is no longer
suitable. But the variation of hardware and the possible approaches we could
take need more careful thinking and consideration before committing to an ABI.

This patch is a good start for this discussion :)


Thanks

--
Qais Yousef