Showing error 1159

User: Jiri Slaby
Error type: Double Unlock
Error type description: Some lock is unlocked twice unintentionally in a sequence
File location: kernel/sched.c
Line in file: 2809
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-04-30 10:52:00 UTC


Source:

2779{
2780        BUG_ON(!irqs_disabled());
2781        if (rq1 == rq2) {
2782                spin_lock(&rq1->lock);
2783                __acquire(rq2->lock);        /* Fake it out ;) */
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 * double_rq_unlock - safely unlock two runqueues
2799 *
2800 * Note this does not restore interrupts like task_rq_unlock,
2801 * you need to do so manually after calling.
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 * double_lock_balance - lock the busiest runqueue, this_rq is locked already.
2816 */
2817static int double_lock_balance(struct rq *this_rq, struct rq *busiest)
2818        __releases(this_rq->lock)
2819        __acquires(busiest->lock)
Show full sources