aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@suse.com>2015-02-09 06:30:00 -0500
committerIngo Molnar <mingo@kernel.org>2015-02-18 10:18:02 -0500
commit890a5409f9d0c84d75a1e16eebdfe91d8a57ef1e (patch)
tree0ef06064cca56ca0493ee395db0b0a8fe8a294f7
parent095bebf61a460ad7f6a45bb17ddbf3a9df2b4397 (diff)
sched/numa: Avoid some pointless iterations
Commit 81907478c431 ("sched/fair: Avoid using uninitialized variable in preferred_group_nid()") unconditionally initializes max_group with NODE_MASK_NONE, this means that when !max_faults (max_group didn't get set), we'll now continue the iteration with an empty mask. Which in turn makes the actual body of the loop go away, so we'll just iterate until completion; short circuit this by breaking out of the loop as soon as this would happen. Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/20150209113727.GS5029@twins.programming.kicks-ass.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/sched/fair.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 28cbacae4e51..ee595ef30470 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1774,6 +1774,8 @@ static int preferred_group_nid(struct task_struct *p, int nid)
1774 } 1774 }
1775 } 1775 }
1776 /* Next round, evaluate the nodes within max_group. */ 1776 /* Next round, evaluate the nodes within max_group. */
1777 if (!max_faults)
1778 break;
1777 nodes = max_group; 1779 nodes = max_group;
1778 } 1780 }
1779 return nid; 1781 return nid;