2779{
2780 BUG_ON(!irqs_disabled());
2781 if (rq1 == rq2) {
2782 spin_lock(&rq1->lock);
2783 __acquire(rq2->lock);
2784 } else {
2785 if (rq1 < rq2) {
2786 spin_lock(&rq1->lock);
2787 spin_lock_nested(&rq2->lock, SINGLE_DEPTH_NESTING);
2788 } else {
2789 spin_lock(&rq2->lock);
2790 spin_lock_nested(&rq1->lock, SINGLE_DEPTH_NESTING);
2791 }
2792 }
2793 update_rq_clock(rq1);
2794 update_rq_clock(rq2);
2795}
2796
2797
2798
2799
2800
2801
2802
2803static void double_rq_unlock(struct rq *rq1, struct rq *rq2)
2804 __releases(rq1->lock)
2805 __releases(rq2->lock)
2806{
2807 spin_unlock(&rq1->lock);
2808 if (rq1 != rq2)
2809 spin_unlock(&rq2->lock);
2810 else
2811 __release(rq2->lock);
2812}
2813
2814
2815
2816
2817static int double_lock_balance(struct rq *this_rq, struct rq *busiest)
2818 __releases(this_rq->lock)
2819 __acquires(busiest->lock)