lkml.org 
[lkml]   [2011]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v1 15/19] sched: update h_load to use u64
    Date
    Calculate tg->h_load using u64 to handle u64 load weights.

    Signed-off-by: Nikhil Rao <ncrao@google.com>
    ---
    kernel/sched.c | 12 +++++++-----
    1 files changed, 7 insertions(+), 5 deletions(-)

    diff --git a/kernel/sched.c b/kernel/sched.c
    index 08dcd24..6b9b02a 100644
    --- a/kernel/sched.c
    +++ b/kernel/sched.c
    @@ -354,7 +354,7 @@ struct cfs_rq {
    * Where f(tg) is the recursive weight fraction assigned to
    * this group.
    */
    - unsigned long h_load;
    + u64 h_load;

    /*
    * Maintaining per-cpu shares distribution for group scheduling
    @@ -1540,15 +1540,17 @@ static unsigned long cpu_avg_load_per_task(int cpu)
    */
    static int tg_load_down(struct task_group *tg, void *data)
    {
    - unsigned long load;
    + u64 load;
    long cpu = (long)data;

    if (!tg->parent) {
    load = cpu_rq(cpu)->load.weight;
    } else {
    - load = tg->parent->cfs_rq[cpu]->h_load;
    - load *= tg->se[cpu]->load.weight;
    - load /= tg->parent->cfs_rq[cpu]->load.weight + 1;
    + u64 parent_h_load = tg->parent->cfs_rq[cpu]->h_load;
    + u64 parent_weight = tg->parent->cfs_rq[cpu]->load.weight;
    +
    + load = div64_u64(parent_h_load * tg->se[cpu]->load.weight,
    + parent_weight + 1);
    }

    tg->cfs_rq[cpu]->h_load = load;
    --
    1.7.3.1


    \
     
     \ /
      Last update: 2011-05-02 03:23    [W:0.020 / U:1.404 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site