Showing error 1149

User: Jiri Slaby
Error type: Double Lock
Error type description: Some lock is locked twice unintentionally in a sequence
File location: kernel/sched.c
Line in file: 965
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-04-29 14:49:11 UTC


Source:

 935
 936/*
 937 * __task_rq_lock - lock the runqueue a given task resides on.
 938 * Must be called interrupts disabled.
 939 */
 940static inline struct rq *__task_rq_lock(struct task_struct *p)
 941        __acquires(rq->lock)
 942{
 943        for (;;) {
 944                struct rq *rq = task_rq(p);
 945                spin_lock(&rq->lock);
 946                if (likely(rq == task_rq(p)))
 947                        return rq;
 948                spin_unlock(&rq->lock);
 949        }
 950}
 951
 952/*
 953 * task_rq_lock - lock the runqueue a given task resides on and disable
 954 * interrupts. Note the ordering: we can safely lookup the task_rq without
 955 * explicitly disabling preemption.
 956 */
 957static struct rq *task_rq_lock(struct task_struct *p, unsigned long *flags)
 958        __acquires(rq->lock)
 959{
 960        struct rq *rq;
 961
 962        for (;;) {
 963                local_irq_save(*flags);
 964                rq = task_rq(p);
 965                spin_lock(&rq->lock);
 966                if (likely(rq == task_rq(p)))
 967                        return rq;
 968                spin_unlock_irqrestore(&rq->lock, *flags);
 969        }
 970}
 971
 972void task_rq_unlock_wait(struct task_struct *p)
 973{
 974        struct rq *rq = task_rq(p);
 975
Show full sources