[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKfTPtAzqkSeys=BbXX-CJuVD2NAfQv7nLT0oi4SYKmwJM3vLQ@mail.gmail.com>
Date: Fri, 27 Mar 2015 16:37:45 +0100
From: Vincent Guittot <vincent.guittot@...aro.org>
To: Xunlei Pang <pang.xunlei@...aro.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
lkml <linux-kernel@...r.kernel.org>,
Preeti U Murthy <preeti@...ux.vnet.ibm.com>,
Morten Rasmussen <Morten.Rasmussen@....com>,
Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>,
Rik van Riel <riel@...hat.com>,
Linaro Kernel Mailman List <linaro-kernel@...ts.linaro.org>,
Mike Galbraith <efault@....de>,
Dietmar Eggemann <dietmar.eggemann@....com>
Subject: Re: [PATCH v10 07/11] sched: get CPU's usage statistic
On 27 March 2015 at 16:12, Xunlei Pang <pang.xunlei@...aro.org> wrote:
> Hi Vincent,
>
> On 27 February 2015 at 23:54, Vincent Guittot
> <vincent.guittot@...aro.org> wrote:
>> Monitor the usage level of each group of each sched_domain level. The usage is
>> the portion of cpu_capacity_orig that is currently used on a CPU or group of
>> CPUs. We use the utilization_load_avg to evaluate the usage level of each
>> group.
>>
>> The utilization_load_avg only takes into account the running time of the CFS
>> tasks on a CPU with a maximum value of SCHED_LOAD_SCALE when the CPU is fully
>> utilized. Nevertheless, we must cap utilization_load_avg which can be temporaly
>> greater than SCHED_LOAD_SCALE after the migration of a task on this CPU and
>> until the metrics are stabilized.
>>
>> + * at 121% + CPU1 usage at 80%) whereas CPU1 has 20% of available capacity/
>> + */
>> +static int get_cpu_usage(int cpu)
>> +{
>> + unsigned long usage = cpu_rq(cpu)->cfs.utilization_load_avg;
>> + unsigned long capacity = capacity_orig_of(cpu);
>> +
>> + if (usage >= SCHED_LOAD_SCALE)
>> + return capacity;
>
> Can "capacity" be greater than SCHED_LOAD_SCALE?
> Why use SCHED_LOAD_SCALE instead of "capacity" in this judgement?
Yes, SCHED_LOAD_SCALE is the default value but the capacity can be in
the range [1536:512] for arm as an example
>
> -Xunlei
>
>> +
>> + return (usage * capacity) >> SCHED_LOAD_SHIFT;
>> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists