[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADcy93WuRMX_PWxSW1k8k0=ArMhvzLo=hX9KiMQbHPrSryeLCA@mail.gmail.com>
Date: Fri, 27 Mar 2015 23:12:19 +0800
From: Xunlei Pang <pang.xunlei@...aro.org>
To: Vincent Guittot <vincent.guittot@...aro.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
lkml <linux-kernel@...r.kernel.org>, preeti@...ux.vnet.ibm.com,
Morten Rasmussen <Morten.Rasmussen@....com>,
kamalesh@...ux.vnet.ibm.com, riel@...hat.com,
Linaro Kernel Mailman List <linaro-kernel@...ts.linaro.org>,
efault@....de, Dietmar Eggemann <dietmar.eggemann@....com>
Subject: Re: [PATCH v10 07/11] sched: get CPU's usage statistic
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?
-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