From f12e4ae122cdca7cce57bef105804e4f94a6b62b Mon Sep 17 00:00:00 2001 From: Miguel de Dios Date: Thu, 7 Feb 2019 17:07:24 -0800 Subject: [PATCH] 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 Signed-off-by: Alexander Winkowski --- kernel/sched/fair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 69391ae291b6..0b1615d223fe 100755 --- a/kernel/sched/fair.c +++ b/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; deactivate_task(env->src_rq, p, DEQUEUE_NOCLOCK); lockdep_off(); +#ifdef CONFIG_SCHED_WALT 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); +#else + set_task_cpu(p, env->dst_cpu); +#endif lockdep_on(); }