lkml.org 
[lkml]   [2019]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 08/11] sched/fair: use utilization to select misfit task
    Date
    utilization is used to detect a misfit task but the load is then used to
    select the task on the CPU which can lead to select a small task with
    high weight instead of the task that triggered the misfit migration.

    Check that task can't fit the CPU's capacity when selecting the misfit
    task instead of using the load.

    Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
    Acked-by: Valentin Schneider <valentin.schneider@arm.com>
    ---
    kernel/sched/fair.c | 11 +++--------
    1 file changed, 3 insertions(+), 8 deletions(-)

    diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
    index 9b8e20d..670856d 100644
    --- a/kernel/sched/fair.c
    +++ b/kernel/sched/fair.c
    @@ -7418,13 +7418,8 @@ static int detach_tasks(struct lb_env *env)
    break;

    case migrate_misfit:
    - load = task_h_load(p);
    -
    - /*
    - * load of misfit task might decrease a bit since it has
    - * been recorded. Be conservative in the condition.
    - */
    - if (load / 2 < env->imbalance)
    + /* This is not a misfit task */
    + if (task_fits_capacity(p, capacity_of(env->src_cpu)))
    goto next;

    env->imbalance = 0;
    @@ -8368,7 +8363,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
    if (busiest->group_type == group_misfit_task) {
    /* Set imbalance to allow misfit task to be balanced. */
    env->migration_type = migrate_misfit;
    - env->imbalance = busiest->group_misfit_task_load;
    + env->imbalance = 1;
    return;
    }

    --
    2.7.4
    \
     
     \ /
      Last update: 2019-10-18 15:27    [W:5.075 / U:0.232 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site