diff options
author | Gregory Haskins <ghaskins@novell.com> | 2008-05-12 15:21:14 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-06 09:19:29 -0400 |
commit | 6d299f1b53b84e2665f402d9bcc494800aba6386 (patch) | |
tree | 52d44fb6e2fe84f180c7e47a0faa5da48be6ab26 /kernel/sched_fair.c | |
parent | 6e0534f278199f1e3dd1049b9bc19a7a5b87ada1 (diff) |
sched: fix SCHED_OTHER balance iterator to include all tasks
The currently logic inadvertently skips the last task on the run-queue,
resulting in missed balance opportunities.
Signed-off-by: Gregory Haskins <ghaskins@novell.com>
Signed-off-by: David Bahi <dbahi@novell.com>
CC: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 08ae848b71d4..1fe4c65a8170 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1275,23 +1275,18 @@ __load_balance_iterator(struct cfs_rq *cfs_rq, struct list_head *next) | |||
1275 | struct task_struct *p = NULL; | 1275 | struct task_struct *p = NULL; |
1276 | struct sched_entity *se; | 1276 | struct sched_entity *se; |
1277 | 1277 | ||
1278 | if (next == &cfs_rq->tasks) | 1278 | while (next != &cfs_rq->tasks) { |
1279 | return NULL; | ||
1280 | |||
1281 | /* Skip over entities that are not tasks */ | ||
1282 | do { | ||
1283 | se = list_entry(next, struct sched_entity, group_node); | 1279 | se = list_entry(next, struct sched_entity, group_node); |
1284 | next = next->next; | 1280 | next = next->next; |
1285 | } while (next != &cfs_rq->tasks && !entity_is_task(se)); | ||
1286 | 1281 | ||
1287 | if (next == &cfs_rq->tasks) | 1282 | /* Skip over entities that are not tasks */ |
1288 | return NULL; | 1283 | if (entity_is_task(se)) { |
1284 | p = task_of(se); | ||
1285 | break; | ||
1286 | } | ||
1287 | } | ||
1289 | 1288 | ||
1290 | cfs_rq->balance_iterator = next; | 1289 | cfs_rq->balance_iterator = next; |
1291 | |||
1292 | if (entity_is_task(se)) | ||
1293 | p = task_of(se); | ||
1294 | |||
1295 | return p; | 1290 | return p; |
1296 | } | 1291 | } |
1297 | 1292 | ||