kernel: sched: account for real time utilization

PELT doesn't account for real time task utilization in cpu_util().
As the result a CPU busy running RT task is considered as low
utilization by the scheduler. Fix this by adding real time loading
in to account.

Bug: 147385228
Test: boot to home and run audio test

Change-Id: Ie4412b186608b9a618f0d35cee9a7310db481f7c
Signed-off-by: Kyle Lin <kylelin@google.com>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
fourteen
Kyle Lin 5 years ago committed by Jenna
parent fcb24c73e4
commit 5f23c8fec1
  1. 13
      kernel/sched/sched.h

@ -2043,7 +2043,12 @@ static inline unsigned long task_util(struct task_struct *p)
*
* Return: the (estimated) utilization for the specified CPU
*/
#ifdef CONFIG_SCHED_WALT
static inline unsigned long cpu_util(int cpu)
#else
static inline unsigned long __cpu_util(int cpu)
#endif
{
struct cfs_rq *cfs_rq;
unsigned int util;
@ -2150,12 +2155,18 @@ static inline unsigned long cpu_util_rt(int cpu)
return rt_rq->avg.util_avg;
}
static inline unsigned long cpu_util(int cpu)
{
return min(__cpu_util(cpu) + cpu_util_rt(cpu), capacity_orig_of(cpu));
}
static inline unsigned long
cpu_util_freq(int cpu, struct sched_walt_cpu_load *walt_load)
{
return min(cpu_util(cpu) + cpu_util_rt(cpu), capacity_orig_of(cpu));
return min(cpu_util(cpu), capacity_orig_of(cpu));
}
#define sched_ravg_window TICK_NSEC
#define sysctl_sched_use_walt_cpu_util 0

Loading…
Cancel
Save