sched/walt: Do the rq clock update before MVP tasks update

The rq clock gets updated in the scheduler tick. However, if the
lock is acquired remotely between the scheduler tick and the
vendor hook, the clock update flags gets reset. Do the clock
update in walt_cfs_account_mvp_runtime based on the clock update
flags.

Change-Id: Ie4254a191a18458cf1684070bc96ff63cf0103d3
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
This commit is contained in:
Pavankumar Kondeti 2021-05-27 10:24:50 +05:30 committed by Rishabh Bhatnagar
parent 5a4738726d
commit d233af280c

View File

@ -830,6 +830,16 @@ static void walt_cfs_account_mvp_runtime(struct rq *rq, struct task_struct *curr
lockdep_assert_held(&rq->lock);
/*
* RQ clock update happens in tick path in the scheduler.
* Since we drop the lock in the scheduler before calling
* into vendor hook, it is possible that update flags are
* reset by another rq lock and unlock. Do the update here
* if required.
*/
if (!(rq->clock_update_flags & RQCF_UPDATED))
update_rq_clock(rq);
/* sum_exec_snapshot can be ahead. See below increment */
delta = curr->se.sum_exec_runtime - wts->sum_exec_snapshot;
if (delta < 0)