mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
ANDROID: FIXUP: sched: fix set_cfs_cpu_capacity when WALT is in use
The CPU utilization reported when WALT is in use already tracks the contributions due to RT and DL workloads. However, SchedFreq exposes different capacity update functions, one for each class, and does classes utilization internally at update_cpu_capacity_request() call time. This patch ensures that when WALT is in use, the: cpu_sched_capacity_reqs::cfs value is tracking just the load generated by SCHED_OTHER tasks. Change-Id: Ibd9c9a10874a1d91f62477034548f7664e57cd6a Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com> Signed-off-by: Andres Oportus <andresoportus@google.com>
This commit is contained in:
committed by
Dmitry Shmidt
parent
3a73c96a28
commit
c4eef1f760
@@ -1674,8 +1674,27 @@ void update_cpu_capacity_request(int cpu, bool request);
|
||||
static inline void set_cfs_cpu_capacity(int cpu, bool request,
|
||||
unsigned long capacity)
|
||||
{
|
||||
if (per_cpu(cpu_sched_capacity_reqs, cpu).cfs != capacity) {
|
||||
per_cpu(cpu_sched_capacity_reqs, cpu).cfs = capacity;
|
||||
struct sched_capacity_reqs *scr = &per_cpu(cpu_sched_capacity_reqs, cpu);
|
||||
|
||||
#ifdef CONFIG_SCHED_WALT
|
||||
if (!walt_disabled && sysctl_sched_use_walt_cpu_util) {
|
||||
int rtdl = scr->rt + scr->dl;
|
||||
/*
|
||||
* WALT tracks the utilization of a CPU considering the load
|
||||
* generated by all the scheduling classes.
|
||||
* Since the following call to:
|
||||
* update_cpu_capacity
|
||||
* is already adding the RT and DL utilizations let's remove
|
||||
* these contributions from the WALT signal.
|
||||
*/
|
||||
if (capacity > rtdl)
|
||||
capacity -= rtdl;
|
||||
else
|
||||
capacity = 0;
|
||||
}
|
||||
#endif
|
||||
if (scr->cfs != capacity) {
|
||||
scr->cfs = capacity;
|
||||
update_cpu_capacity_request(cpu, request);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user