[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-890a5409f9d0c84d75a1e16eebdfe91d8a57ef1e@git.kernel.org>
Date: Wed, 18 Feb 2015 09:10:29 -0800
From: tip-bot for Jan Beulich <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, JBeulich@...e.com, jbeulich@...e.com,
linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
peterz@...radead.org, tglx@...utronix.de, hpa@...or.com
Subject: [tip:sched/core] sched/numa: Avoid some pointless iterations
Commit-ID: 890a5409f9d0c84d75a1e16eebdfe91d8a57ef1e
Gitweb: http://git.kernel.org/tip/890a5409f9d0c84d75a1e16eebdfe91d8a57ef1e
Author: Jan Beulich <JBeulich@...e.com>
AuthorDate: Mon, 9 Feb 2015 12:30:00 +0100
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Wed, 18 Feb 2015 16:18:02 +0100
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@...e.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Link: http://lkml.kernel.org/r/20150209113727.GS5029@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/fair.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 28cbaca..ee595ef 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)
}
}
/* Next round, evaluate the nodes within max_group. */
+ if (!max_faults)
+ break;
nodes = max_group;
}
return nid;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists