Showing error 1711

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: 2831
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 15:16:58 UTC


Source:

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)
2820        __acquires(this_rq->lock)
2821{
2822        int ret = 0;
2823
2824        if (unlikely(!irqs_disabled())) {
2825                /* printk() doesn't work good under rq->lock */
2826                spin_unlock(&this_rq->lock);
2827                BUG_ON(1);
2828        }
2829        if (unlikely(!spin_trylock(&busiest->lock))) {
2830                if (busiest < this_rq) {
2831                        spin_unlock(&this_rq->lock);
2832                        spin_lock(&busiest->lock);
2833                        spin_lock_nested(&this_rq->lock, SINGLE_DEPTH_NESTING);
2834                        ret = 1;
2835                } else
2836                        spin_lock_nested(&busiest->lock, SINGLE_DEPTH_NESTING);
2837        }
2838        return ret;
2839}
2840
2841static void double_unlock_balance(struct rq *this_rq, struct rq *busiest)
Show full sources