mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ANDROID: sched/fair: Sync task util early in feec
The vendor hook in find_energy_efficient_cpu() currently sees a potentially stale task utilization. Make sure to sync it beforehand to avoid any issues by moving the call at the top of the function. This also ensures the check on task_fits_capacity() when the sync flag is set sees an up-to-date task util. Fixes:a9c5fcfe9c("ANDROID: sched/fair: Have sync honor fits_capacity") Fixes:147a9b3d9e("ANDROID: sched: Add vendor hooks for find_energy_efficient_cpu") Signed-off-by: Quentin Perret <qperret@google.com> Change-Id: Ie9a6c89249a2aefbccced4786ce4d4728e39dd12
This commit is contained in:
@@ -6602,6 +6602,7 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy
|
||||
struct perf_domain *pd;
|
||||
int new_cpu = INT_MAX;
|
||||
|
||||
sync_entity_load_avg(&p->se);
|
||||
trace_android_rvh_find_energy_efficient_cpu(p, prev_cpu, sync, &new_cpu);
|
||||
if (new_cpu != INT_MAX)
|
||||
return new_cpu;
|
||||
@@ -6629,7 +6630,6 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy
|
||||
if (!sd)
|
||||
goto fail;
|
||||
|
||||
sync_entity_load_avg(&p->se);
|
||||
if (!task_util_est(p))
|
||||
goto unlock;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user