Skip to content

Commit 5fdbc79

Browse files
Brendan Jackmanpundiramit
authored andcommitted
BACKPORT: sched/fair: Fix find_idlest_group when local group is not allowed
When the local group is not allowed we do not modify this_*_load from their initial value of 0. That means that the load checks at the end of find_idlest_group cause us to incorrectly return NULL. Fixing the initial values to ULONG_MAX means we will instead return the idlest remote group in that case. BACKPORT: Note 4.4 is missing commit 6b94780e45c1 "sched/core: Use load_avg for selecting idlest group", so we only have to fix this_load instead of this_runnable_load and this_avg_load. Change-Id: I41f775b0e7c8f5e675c2780f955bb130a563cba7 Signed-off-by: Brendan Jackman <brendan.jackman@arm.com> Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org> Reviewed-by: Josef Bacik <jbacik@fb.com> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com> Cc: Vincent Guittot <vincent.guittot@linaro.org> Cc: Josef Bacik <josef@toxicpanda.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Morten Rasmussen <morten.rasmussen@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20171005114516.18617-4-brendan.jackman@arm.com Signed-off-by: Ingo Molnar <mingo@kernel.org> (cherry-picked-from: commit 0d10ab952e99 tip:sched/core) (backport changes described above) Signed-off-by: Chris Redpath <chris.redpath@arm.com>
1 parent e38a80f commit 5fdbc79

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5983,7 +5983,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p,
59835983
{
59845984
struct sched_group *idlest = NULL, *group = sd->groups;
59855985
struct sched_group *most_spare_sg = NULL;
5986-
unsigned long min_load = ULONG_MAX, this_load = 0;
5986+
unsigned long min_load = ULONG_MAX, this_load = ULONG_MAX;
59875987
unsigned long most_spare = 0, this_spare = 0;
59885988
int load_idx = sd->forkexec_idx;
59895989
int imbalance = 100 + (sd->imbalance_pct-100)/2;

0 commit comments

Comments
 (0)