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: | 2789 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
|
Entered: | 2012-04-29 14:49:11 UTC |
2759 * prevents us from getting stuck on 9 if the load is 10, for 2760 * example. 2761 */ 2762 if (new_load > old_load) 2763 new_load += scale-1; 2764 this_rq->cpu_load[i] = (old_load*(scale-1) + new_load) >> i; 2765 } 2766} 2767 2768#ifdef CONFIG_SMP 2769 2770/* 2771 * double_rq_lock - safely lock two runqueues 2772 * 2773 * Note this does not disable interrupts like task_rq_lock, 2774 * you need to do so manually before calling. 2775 */ 2776static void double_rq_lock(struct rq *rq1, struct rq *rq2) 2777 __acquires(rq1->lock) 2778 __acquires(rq2->lock) 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 *