diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 1847a4456a2d..b4dab63c6dbd 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -1955,7 +1955,7 @@ static int move_tasks(runqueue_t *this_rq, int this_cpu, runqueue_t *busiest, | |||
1955 | { | 1955 | { |
1956 | prio_array_t *array, *dst_array; | 1956 | prio_array_t *array, *dst_array; |
1957 | struct list_head *head, *curr; | 1957 | struct list_head *head, *curr; |
1958 | int idx, pulled = 0, pinned = 0; | 1958 | int idx, pulled = 0, pinned = 0, this_min_prio; |
1959 | long rem_load_move; | 1959 | long rem_load_move; |
1960 | task_t *tmp; | 1960 | task_t *tmp; |
1961 | 1961 | ||
@@ -1964,6 +1964,7 @@ static int move_tasks(runqueue_t *this_rq, int this_cpu, runqueue_t *busiest, | |||
1964 | 1964 | ||
1965 | rem_load_move = max_load_move; | 1965 | rem_load_move = max_load_move; |
1966 | pinned = 1; | 1966 | pinned = 1; |
1967 | this_min_prio = this_rq->curr->prio; | ||
1967 | 1968 | ||
1968 | /* | 1969 | /* |
1969 | * We first consider expired tasks. Those will likely not be | 1970 | * We first consider expired tasks. Those will likely not be |
@@ -2003,7 +2004,12 @@ skip_queue: | |||
2003 | 2004 | ||
2004 | curr = curr->prev; | 2005 | curr = curr->prev; |
2005 | 2006 | ||
2006 | if (tmp->load_weight > rem_load_move || | 2007 | /* |
2008 | * To help distribute high priority tasks accross CPUs we don't | ||
2009 | * skip a task if it will be the highest priority task (i.e. smallest | ||
2010 | * prio value) on its new queue regardless of its load weight | ||
2011 | */ | ||
2012 | if ((idx >= this_min_prio && tmp->load_weight > rem_load_move) || | ||
2007 | !can_migrate_task(tmp, busiest, this_cpu, sd, idle, &pinned)) { | 2013 | !can_migrate_task(tmp, busiest, this_cpu, sd, idle, &pinned)) { |
2008 | if (curr != head) | 2014 | if (curr != head) |
2009 | goto skip_queue; | 2015 | goto skip_queue; |
@@ -2025,6 +2031,8 @@ skip_queue: | |||
2025 | * and the prescribed amount of weighted load. | 2031 | * and the prescribed amount of weighted load. |
2026 | */ | 2032 | */ |
2027 | if (pulled < max_nr_move && rem_load_move > 0) { | 2033 | if (pulled < max_nr_move && rem_load_move > 0) { |
2034 | if (idx < this_min_prio) | ||
2035 | this_min_prio = idx; | ||
2028 | if (curr != head) | 2036 | if (curr != head) |
2029 | goto skip_queue; | 2037 | goto skip_queue; |
2030 | idx++; | 2038 | idx++; |