Commit 6d299f1b authored by Gregory Haskins's avatar Gregory Haskins Committed by Ingo Molnar

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: default avatarGregory Haskins <ghaskins@novell.com>
Signed-off-by: default avatarDavid Bahi <dbahi@novell.com>
CC: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 6e0534f2
...@@ -1275,23 +1275,18 @@ __load_balance_iterator(struct cfs_rq *cfs_rq, struct list_head *next) ...@@ -1275,23 +1275,18 @@ __load_balance_iterator(struct cfs_rq *cfs_rq, struct list_head *next)
struct task_struct *p = NULL; struct task_struct *p = NULL;
struct sched_entity *se; struct sched_entity *se;
if (next == &cfs_rq->tasks) while (next != &cfs_rq->tasks) {
return NULL;
/* Skip over entities that are not tasks */
do {
se = list_entry(next, struct sched_entity, group_node); se = list_entry(next, struct sched_entity, group_node);
next = next->next; next = next->next;
} while (next != &cfs_rq->tasks && !entity_is_task(se));
if (next == &cfs_rq->tasks) /* Skip over entities that are not tasks */
return NULL; if (entity_is_task(se)) {
p = task_of(se);
break;
}
}
cfs_rq->balance_iterator = next; cfs_rq->balance_iterator = next;
if (entity_is_task(se))
p = task_of(se);
return p; return p;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment