]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
sched: Add a lock break for PREEMPT=y
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Thu, 17 Dec 2009 17:10:09 +0000 (18:10 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 21 Jan 2010 12:40:13 +0000 (13:40 +0100)
Since load-balancing can hold rq->locks for quite a long while, allow
breaking out early when there is lock contention.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_fair.c

index 93fccbadde239616039720ebc34b2f2fbc48347c..65d08207e925d99323c7cc2b5356afaac699a140 100644 (file)
@@ -2065,6 +2065,10 @@ static int move_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest,
                 */
                if (idle == CPU_NEWLY_IDLE && this_rq->nr_running)
                        break;
+
+               if (raw_spin_is_contended(&this_rq->lock) ||
+                               raw_spin_is_contended(&busiest->lock))
+                       break;
 #endif
        } while (load_moved && max_load_move > total_load_moved);