Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 890a5409 authored by Jan Beulich's avatar Jan Beulich Committed by Ingo Molnar
Browse files

sched/numa: Avoid some pointless iterations



Commit 81907478 ("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: default avatarJan Beulich <jbeulich@suse.com>
Signed-off-by: default avatarPeter 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: default avatarIngo Molnar <mingo@kernel.org>
parent 095bebf6
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1774,6 +1774,8 @@ static int preferred_group_nid(struct task_struct *p, int nid)
			}
			}
		}
		}
		/* Next round, evaluate the nodes within max_group. */
		/* Next round, evaluate the nodes within max_group. */
		if (!max_faults)
			break;
		nodes = max_group;
		nodes = max_group;
	}
	}
	return nid;
	return nid;