[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 10 Oct 2014 16:38:06 +0200
From: Vincent Guittot <vincent.guittot@...aro.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...nel.org>,
linux-kernel <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>,
Russell King - ARM Linux <linux@....linux.org.uk>,
LAK <linux-arm-kernel@...ts.infradead.org>,
Rik van Riel <riel@...hat.com>,
Mike Galbraith <efault@....de>,
Nicolas Pitre <nicolas.pitre@...aro.org>,
"linaro-kernel@...ts.linaro.org" <linaro-kernel@...ts.linaro.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Paul Turner <pjt@...gle.com>,
Benjamin Segall <bsegall@...gle.com>
Subject: Re: [PATCH v7 5/7] sched: get CPU's usage statistic
On 9 October 2014 17:12, Peter Zijlstra <peterz@...radead.org> 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 + 1;
>> >
>> > Like Morten I'm confused by that +1 thing.
>>
>> ok. the goal was to point out the erroneous case where usage is out of
>> the range but if it generates confusion, it can remove it
>
> Well, the fact that you clip makes that point, returning a value outside
> of the specified range doesn't.
i meant removing the +1
--
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