mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
sched/fair: Favor higher cpus only for boosted tasks
This CL separates the notion of boost and prefer_idle schedtune attributes in cpu selection. Today only top-app tasks are boosted. The CPU selection is slightly tweaked such that higher order cpus are preferred only for boosted tasks (top-app) and the rest would be skewed towards lower order cpus. This avoids starvation issues for fg tasks when interacting with high priority top-app tasks (a problem often seen in the case of system_server). bug: 30245369 bug: 30292998 Change-Id: I0377e00893b9f6586eec55632a265518fd2fa8a1 Conflicts: kernel/sched/fair.c
This commit is contained in:
committed by
Amit Pundir
parent
e86992e170
commit
bfa1dd2bfd
@@ -5612,7 +5612,7 @@ done:
|
||||
return target;
|
||||
}
|
||||
|
||||
static inline int find_best_target(struct task_struct *p, bool prefer_idle)
|
||||
static inline int find_best_target(struct task_struct *p, bool boosted, bool prefer_idle)
|
||||
{
|
||||
int iter_cpu;
|
||||
int target_cpu = -1;
|
||||
@@ -5630,9 +5630,9 @@ static inline int find_best_target(struct task_struct *p, bool prefer_idle)
|
||||
int idle_idx;
|
||||
|
||||
/*
|
||||
* favor higher cpus for tasks that prefer idle cores
|
||||
* Iterate from higher cpus for boosted tasks.
|
||||
*/
|
||||
int i = prefer_idle ? NR_CPUS-iter_cpu-1 : iter_cpu;
|
||||
int i = boosted ? NR_CPUS-iter_cpu-1 : iter_cpu;
|
||||
|
||||
if (!cpu_online(i) || !cpumask_test_cpu(i, tsk_cpus_allowed(p)))
|
||||
continue;
|
||||
@@ -5802,7 +5802,7 @@ static int energy_aware_wake_cpu(struct task_struct *p, int target, int sync)
|
||||
bool boosted = 0;
|
||||
bool prefer_idle = 0;
|
||||
#endif
|
||||
int tmp_target = find_best_target(p, boosted || prefer_idle);
|
||||
int tmp_target = find_best_target(p, boosted, prefer_idle);
|
||||
if (tmp_target >= 0) {
|
||||
target_cpu = tmp_target;
|
||||
if ((boosted || prefer_idle) && idle_cpu(target_cpu))
|
||||
|
||||
Reference in New Issue
Block a user