lkml.org 
[lkml]   [2012]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[RFC PATCH 12/13] sched: Modify find_idlest_cpu to use PJT's metric
    From
    Date
    Additional parameters introduced to perform this function which are
    calculated using PJT's metrics and its helpers.

    Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
    ---
    kernel/sched/fair.c | 8 +++++---
    1 file changed, 5 insertions(+), 3 deletions(-)

    diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
    index c64be1c1..15ec528 100644
    --- a/kernel/sched/fair.c
    +++ b/kernel/sched/fair.c
    @@ -3230,16 +3230,18 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p,
    static int
    find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
    {
    - unsigned long load, min_load = ULONG_MAX;
    + unsigned long load;
    + u64 cpu_load, min_cpu_load = ~0ULL;
    int idlest = -1;
    int i;

    /* Traverse only the allowed CPUs */
    for_each_cpu_and(i, sched_group_cpus(group), tsk_cpus_allowed(p)) {
    load = weighted_cpuload(i);
    + cpu_load = cpu_rq(i)->cfs.runnable_load_avg;

    - if (load < min_load || (load == min_load && i == this_cpu)) {
    - min_load = load;
    + if (cpu_load < min_cpu_load || (cpu_load == min_cpu_load && i == this_cpu)) {
    + min_cpu_load = cpu_load;
    idlest = i;
    }
    }


    \
     
     \ /
      Last update: 2012-10-25 13:21    [W:2.246 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site