[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150522153804.GF26396@e105550-lin.cambridge.arm.com>
Date: Fri, 22 May 2015 16:38:04 +0100
From: Morten Rasmussen <morten.rasmussen@....com>
To: Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>
Cc: "peterz@...radead.org" <peterz@...radead.org>,
"mingo@...hat.com" <mingo@...hat.com>,
"vincent.guittot@...aro.org" <vincent.guittot@...aro.org>,
Dietmar Eggemann <Dietmar.Eggemann@....com>,
"yuyang.du@...el.com" <yuyang.du@...el.com>,
"preeti@...ux.vnet.ibm.com" <preeti@...ux.vnet.ibm.com>,
"mturquette@...aro.org" <mturquette@...aro.org>,
"rjw@...ysocki.net" <rjw@...ysocki.net>,
Juri Lelli <Juri.Lelli@....com>,
"sgurrappadi@...dia.com" <sgurrappadi@...dia.com>,
"pang.xunlei@....com.cn" <pang.xunlei@....com.cn>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>
Subject: Re: [RFCv4 PATCH 22/34] sched: Calculate energy consumption of
sched_group
On Thu, May 21, 2015 at 08:57:04AM +0100, Kamalesh Babulal wrote:
> * Morten Rasmussen <morten.rasmussen@....com> [2015-05-12 20:38:57]:
>
> [...]
> > +/*
> > + * cpu_norm_usage() returns the cpu usage relative to a specific capacity,
> > + * i.e. it's busy ratio, in the range [0..SCHED_LOAD_SCALE] which is useful for
> > + * energy calculations. Using the scale-invariant usage returned by
> > + * get_cpu_usage() and approximating scale-invariant usage by:
> > + *
> > + * usage ~ (curr_freq/max_freq)*1024 * capacity_orig/1024 * running_time/time
> > + *
> > + * the normalized usage can be found using the specific capacity.
> > + *
> > + * capacity = capacity_orig * curr_freq/max_freq
> > + *
> > + * norm_usage = running_time/time ~ usage/capacity
> > + */
> > +static unsigned long cpu_norm_usage(int cpu, unsigned long capacity)
> > +{
> > + int usage = __get_cpu_usage(cpu);
>
> __get_cpu_usage is introduced in next patch "sched: Extend sched_group_energy
> to test load-balancing decisions", applying the series with this patch as top
> most patch breaks the build.
>
> kernel/sched/fair.c: In function ‘cpu_norm_usage’:
> kernel/sched/fair.c:4830:2: error: implicit declaration of function ‘__get_cpu_usage’ [-Werror=implicit-function-declaration]
> int usage = __get_cpu_usage(cpu);
> ^
>
> Given that __get_cpu_usage(), take additional parameter - delta. get_cpu_usage()
> should have been used here.
Yes, you are right. Using get_cpu_usage() here instead should be
correct. I think it was right in RFCv3, I must have messed it up when I
moved around some of the patches :(
I will make sure to test the patch set is bisectable next time :)
Thanks,
Morten
--
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