diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-12-17 12:10:09 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-01-21 07:40:13 -0500 |
commit | baa8c1102f0cd86e69c1497d61d2ee177e663663 (patch) | |
tree | d87729687336b8f4c1e4e08a34f84587d073eaf4 | |
parent | 230059de77a4e0f6afba98073e73bc9fd471506e (diff) |
sched: Add a lock break for PREEMPT=y
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>
-rw-r--r-- | kernel/sched_fair.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 93fccbadde23..65d08207e925 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -2065,6 +2065,10 @@ static int move_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest, | |||
2065 | */ | 2065 | */ |
2066 | if (idle == CPU_NEWLY_IDLE && this_rq->nr_running) | 2066 | if (idle == CPU_NEWLY_IDLE && this_rq->nr_running) |
2067 | break; | 2067 | break; |
2068 | |||
2069 | if (raw_spin_is_contended(&this_rq->lock) || | ||
2070 | raw_spin_is_contended(&busiest->lock)) | ||
2071 | break; | ||
2068 | #endif | 2072 | #endif |
2069 | } while (load_moved && max_load_move > total_load_moved); | 2073 | } while (load_moved && max_load_move > total_load_moved); |
2070 | 2074 | ||