lkml.org 
[lkml]   [2014]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH RFC 3/7] sched: fair: add usage_util_of helper
    Date
    Signed-off-by: Mike Turquette <mturquette@linaro.org>
    ---
    kernel/sched/fair.c | 6 ++++++
    kernel/sched/sched.h | 1 +
    2 files changed, 7 insertions(+)

    diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
    index 15f5638..0930ad8 100644
    --- a/kernel/sched/fair.c
    +++ b/kernel/sched/fair.c
    @@ -2057,6 +2057,7 @@ static inline void account_numa_dequeue(struct rq *rq, struct task_struct *p)

    #ifdef CONFIG_SMP
    unsigned long capacity_of(int cpu);
    +unsigned long usage_util_of(int cpu);
    #endif /* CONFIG_SMP */

    static void
    @@ -4140,6 +4141,11 @@ unsigned long capacity_of(int cpu)
    return cpu_rq(cpu)->cpu_capacity;
    }

    +unsigned long usage_util_of(int cpu)
    +{
    + return cpu_rq(cpu)->cfs.usage_util_avg;
    +}
    +
    static unsigned long cpu_avg_load_per_task(int cpu)
    {
    struct rq *rq = cpu_rq(cpu);
    diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
    index 9a28d38..c34cbfc 100644
    --- a/kernel/sched/sched.h
    +++ b/kernel/sched/sched.h
    @@ -310,6 +310,7 @@ struct cfs_bandwidth { };
    #endif /* CONFIG_CGROUP_SCHED */

    extern unsigned long capacity_of(int cpu);
    +extern unsigned long usage_util_of(int cpu);

    /* CFS-related fields in a runqueue */
    struct cfs_rq {
    --
    1.8.3.2


    \
     
     \ /
      Last update: 2014-10-22 08:41    [W:5.567 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site