From: Andrey Ryabinin <aryabi...@virtuozzo.com>

Lockdep complains that after rq_repin_lock() the lock wasn't unpinned
before rq->lock release.

Add rq_unpin_lock(); call to fix this. Also for consistency use 'busiest'
instead of 'env.src_rq' which is the same.

https://jira.sw.ru/browse/PSBM-120800
Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com>
Reviewed-by: Kirill Tkhai <ktk...@virtuozzo.com>

(cherry-picked from vz8 commit 9c9976ed56ec ("kernel/sched/fair: Fix
'releasing a pinned lock'"))

Signed-off-by: Nikita Yushchenko <nikita.yushche...@virtuozzo.com>
---
 kernel/sched/fair.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e5b9d9d26e78..556bd109049a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -10199,9 +10199,10 @@ static int load_balance(int this_cpu, struct rq 
*this_rq,
                        env.loop = 0;
                        local_irq_save(rf.flags);
                        double_rq_lock(env.dst_rq, busiest);
-                       rq_repin_lock(env.src_rq, &rf);
+                       rq_repin_lock(busiest, &rf);
                        update_rq_clock(env.dst_rq);
                        cur_ld_moved = ld_moved = move_task_groups(&env);
+                       rq_unpin_lock(busiest, &rf);
                        double_rq_unlock(env.dst_rq, busiest);
                        local_irq_restore(rf.flags);
                 }
-- 
2.30.2

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to