The case where we try to acquire the lock on 2 runqueues belonging to 2
different cores requires the rq_lockp wrapper as well otherwise we
frequently deadlock in there.

This fixes the crash reported in
[email protected]

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 76fee56..71bb71f 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2078,7 +2078,7 @@ static inline void double_rq_lock(struct rq *rq1, struct 
rq *rq2)
                raw_spin_lock(rq_lockp(rq1));
                __acquire(rq2->lock);   /* Fake it out ;) */
        } else {
-               if (rq1 < rq2) {
+               if (rq_lockp(rq1) < rq_lockp(rq2)) {
                        raw_spin_lock(rq_lockp(rq1));
                        raw_spin_lock_nested(rq_lockp(rq2), 
SINGLE_DEPTH_NESTING);
                } else {
-- 
2.7.4

Reply via email to