sched: fair: Disable double lock/unlock balance in detach_task()

CONFIG_LOCK_STAT shows warnings in detach_task() for releasing a
pinned lock. The warnings are due to the calls to
double_unlock_balance() added to snapshot WALT. Lets disable them if
not building with SCHED_WALT.

Bug: 123720375
Change-Id: Ibfa28b1434fa6006fa0117fd2df1a3eadb321568
Signed-off-by: Miguel de Dios <migueldedios@google.com>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
fourteen
Miguel de Dios 6 years ago committed by Jenna
parent a4bf74d008
commit f12e4ae122
  1. 4
      kernel/sched/fair.c

@ -9307,11 +9307,15 @@ static void detach_task(struct task_struct *p, struct lb_env *env)
p->on_rq = TASK_ON_RQ_MIGRATING; p->on_rq = TASK_ON_RQ_MIGRATING;
deactivate_task(env->src_rq, p, DEQUEUE_NOCLOCK); deactivate_task(env->src_rq, p, DEQUEUE_NOCLOCK);
lockdep_off(); lockdep_off();
#ifdef CONFIG_SCHED_WALT
double_lock_balance(env->src_rq, env->dst_rq); double_lock_balance(env->src_rq, env->dst_rq);
if (!(env->src_rq->clock_update_flags & RQCF_UPDATED)) if (!(env->src_rq->clock_update_flags & RQCF_UPDATED))
update_rq_clock(env->src_rq); update_rq_clock(env->src_rq);
set_task_cpu(p, env->dst_cpu); set_task_cpu(p, env->dst_cpu);
double_unlock_balance(env->src_rq, env->dst_rq); double_unlock_balance(env->src_rq, env->dst_rq);
#else
set_task_cpu(p, env->dst_cpu);
#endif
lockdep_on(); lockdep_on();
} }

Loading…
Cancel
Save