Re: [PATCH v10 07/11] sched: get CPU's usage statistic

From: Xunlei Pang
Date: Tue Mar 31 2015 - 23:22:46 EST


Vincent,
On 27 March 2015 at 23:37, Vincent Guittot <vincent.guittot@xxxxxxxxxx> wrote:
> On 27 March 2015 at 16:12, Xunlei Pang <pang.xunlei@xxxxxxxxxx> wrote:
>>> +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

Right, I was confused between cpu capacity and
arch_scale_freq_capacity() in "Patch 04" then. Thanks.

-Xunlei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/