ANDROID: sched/fair: Sync task util for strf hook

The vendor hook in select_task_rq_fair() currently sees a potentially
stale task utilization. Make sure to sync it beforehand to avoid any
issues.

Fixes: a1fc1fba46 ("ANDROID: sched: add restrict vendor hook to modify task placement policy in EAS")
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I7675ce9fd37b160f8a7ba9651ae73b69a16d6d12
This commit is contained in:
Quentin Perret 2021-01-07 09:20:25 +00:00
parent eadbc20d0d
commit c7ba09ce6a

View File

@ -6763,6 +6763,8 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f
int sync = (wake_flags & WF_SYNC) && !(current->flags & PF_EXITING);
int target_cpu = -1;
if (trace_android_rvh_select_task_rq_fair_enabled())
sync_entity_load_avg(&p->se);
trace_android_rvh_select_task_rq_fair(p, prev_cpu, sd_flag,
wake_flags, &target_cpu);
if (target_cpu >= 0)