Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932134AbbEUH5V (ORCPT ); Thu, 21 May 2015 03:57:21 -0400 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:56089 "EHLO e28smtp08.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753607AbbEUH5R (ORCPT ); Thu, 21 May 2015 03:57:17 -0400 Date: Thu, 21 May 2015 13:27:04 +0530 From: Kamalesh Babulal To: Morten Rasmussen Cc: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org, Dietmar Eggemann , yuyang.du@intel.com, preeti@linux.vnet.ibm.com, mturquette@linaro.org, rjw@rjwysocki.net, Juri Lelli , sgurrappadi@nvidia.com, pang.xunlei@zte.com.cn, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [RFCv4 PATCH 22/34] sched: Calculate energy consumption of sched_group Message-ID: <20150521075702.GA20008@linux.vnet.ibm.com> Reply-To: Kamalesh Babulal References: <1431459549-18343-1-git-send-email-morten.rasmussen@arm.com> <1431459549-18343-23-git-send-email-morten.rasmussen@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1431459549-18343-23-git-send-email-morten.rasmussen@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15052107-0029-0000-0000-0000060B3ED5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1574 Lines: 41 * Morten Rasmussen [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. Thanks, Kamalesh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/