Skip to content

Commit

Permalink
sched/numa: Simplify task_numa_compare()
Browse files Browse the repository at this point in the history
When a task is part of a numa_group, the comparison should always use
the group weight, in order to make workloads converge.

Signed-off-by: Rik van Riel <riel@redhat.com>
Cc: chegu_vinod@hp.com
Cc: mgorman@suse.de
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1403538378-31571-4-git-send-email-riel@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Rik van Riel authored and Ingo Molnar committed Jul 5, 2014
1 parent 6dc1a67 commit 1c5d3eb
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ static void task_numa_compare(struct task_numa_env *env,
struct task_group *tg;
long src_load, dst_load;
long load;
long imp = (groupimp > 0) ? groupimp : taskimp;
long imp = env->p->numa_group ? groupimp : taskimp;

rcu_read_lock();
cur = ACCESS_ONCE(dst_rq->curr);
Expand Down Expand Up @@ -1192,11 +1192,6 @@ static void task_numa_compare(struct task_numa_env *env,
* itself (not part of a group), use the task weight
* instead.
*/
if (env->p->numa_group)
imp = groupimp;
else
imp = taskimp;

if (cur->numa_group)
imp += group_weight(cur, env->src_nid) -
group_weight(cur, env->dst_nid);
Expand Down

0 comments on commit 1c5d3eb

Please sign in to comment.