Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1f460c9 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar Committed by Gerrit - the friendly Code Review server
Browse files

sched/fair: fix update_flags < RQCF_ACT_SKIP warning



A typical backtrace

 assert_clock_updated()
 rq_clock_task()
 task_hot()
 can_migrate_task()
 detach_tasks()
 load_balance()
 rebalance_domains()
 nohz_idle_balance()
 run_rebalance_domains()

WALT accounting introduces a double rq lock in detach_task. This
could lead to a release and reacquire of the rq lock. That release
could cause other context to grab it and clear the RQCF_UPDATED
flag.

So once the lock is reacquired check if the RQCF_UPDATED flag is lost
and if it is, call update_rq_clock() with sets the flag and updates
the rq clock too.

Change-Id: If829ddd23add02459da7876f42cd7dc55559ccc8
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent be49c613
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -8599,6 +8599,8 @@ static void detach_task(struct task_struct *p, struct lb_env *env)
	p->on_rq = TASK_ON_RQ_MIGRATING;
	deactivate_task(env->src_rq, p, DEQUEUE_NOCLOCK);
	double_lock_balance(env->src_rq, env->dst_rq);
	if (!(env->src_rq->clock_update_flags & RQCF_UPDATED))
		update_rq_clock(env->src_rq);
	set_task_cpu(p, env->dst_cpu);
	double_unlock_balance(env->src_rq, env->dst_rq);
}