Re: [PATCH] sched: Take thermal pressure into account when determine rt fits capacity
From: Qais Yousef
Date: Tue Apr 26 2022 - 09:06:52 EST
On 04/26/22 12:06, Vincent Guittot wrote:
> > Wouldn't this be expensive to have 3 loops? That was my other suggestion but
> > wasn't sure the complexity was worth it. So I suggested handling the capacity
> > inversion case only.
> 3 loops might be too expensive. I mainly want to make sure to
> understand what should be done to fix Xuewen case without breaking
> others. Then we can see how to optimize this in a reasonable number of
The generic solution is what I tried to outline before:
> So if we want to handle this case, then we need to ensure the search returns
> false only if
> 1. Thermal pressure results in real OPP to be omitted.
> 2. Another CPU that can provide this performance level is available.
> Otherwise we should still fit it on this CPU because it'll give us the closest
> thing to what was requested.
And we can do this in 2 ways, 3 loops as you said, or by creating a fallback
cpumask as we search so that by the end we can resolve to it if we didn't find
the best fit.
My only worry here is that Xuewen doesn't see thermal issues on mids, so
testability is a problem. This generic solution will only help with the case of
mids losing some OPPs at the top, then we can do better by selecting a big core
instead of a medium (if not in capacity inversion itself).
I *think* (and I don't feel strongly about it at all), checking for capacity
inversion and bypassing that cpu, or only then consider its thermal pressure,
is the right approach to take here until someone reports more woes due to
That said, the generic solution might not be that bad actually and I'm just
being a bit conservative. So would be good to hear what others think.