Re: [RFC,v2 3/3] sched: ignore task_h_load for CPU_NEWLY_IDLE

From: Mike Galbraith
Date: Wed Feb 08 2017 - 04:43:22 EST


On Wed, 2017-02-08 at 09:43 +0100, Uladzislau Rezki wrote:
> From: Uladzislau 2 Rezki <uladzislau2.rezki@xxxxxxxxxxxxxx>
>
> A load balancer calculates imbalance factor for particular shed
^sched
> domain and tries to steal up the prescribed amount of weighted load.
> However, a small imbalance factor would sometimes prevent us from
> stealing any tasks at all. When a CPU is newly idle, it should
> steal first task which passes a migration criteria.
s/passes a/meets the
>
> Signed-off-by: Uladzislau 2 Rezki <uladzislau2.rezki@xxxxxxxxxxxxxx>
> ---
> kernel/sched/fair.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 232ef3c..29e0d7f 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> > > env->loop++;
> @@ -6824,8 +6832,9 @@ static int detach_tasks(struct lb_env *env)
> > > > if (sched_feat(LB_MIN) && load < 16 && !env->sd->nr_balance_failed)
> > > > > goto next;
>
> -> > > if ((load / 2) > env->imbalance)
> -> > > > goto next;
> +> > > if (env->idle != CPU_NEWLY_IDLE)
> +> > > > if ((load / 2) > env->imbalance)
> +> > > > > goto next;

Those two ifs could be one ala if (foo && bar).