linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Lukasz Luba <lukasz.luba@arm.com>,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Cc: amitk@kernel.org, rui.zhang@intel.com, viresh.kumar@linaro.org,
	rafael@kernel.org, dietmar.eggemann@arm.com, nm@ti.com,
	sboyd@kernel.org, sudeep.holla@arm.com, cristian.marussi@arm.com,
	matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/4] PM: EM: convert power field to micro-Watts precision and align drivers
Date: Thu, 7 Jul 2022 10:31:09 +0200	[thread overview]
Message-ID: <9b4bd8b5-d5d9-7f75-128a-87b727ad0bd7@linaro.org> (raw)
In-Reply-To: <20220707071555.10085-2-lukasz.luba@arm.com>

On 07/07/2022 09:15, Lukasz Luba wrote:
> The milli-Watts precision causes rounding errors while calculating
> efficiency cost for each OPP. This is especially visible in the 'simple'
> Energy Model (EM), where the power for each OPP is provided from OPP
> framework. This can cause some OPPs to be marked inefficient, while
> using micro-Watts precision that might not happen.
> 
> Update all EM users which access 'power' field and assume the value is
> in milli-Watts.
> 
> Solve also an issue with potential overflow in calculation of energy
> estimation on 32bit machine. It's needed now since the power value
> (thus the 'cost' as well) are higher.
> 
> Example calculation which shows the rounding error and impact:
> 
> power = 'dyn-power-coeff' * volt_mV * volt_mV * freq_MHz
> 
> power_a_uW = (100 * 600mW * 600mW * 500MHz) / 10^6 = 18000
> power_a_mW = (100 * 600mW * 600mW * 500MHz) / 10^9 = 18
> 
> power_b_uW = (100 * 605mW * 605mW * 600MHz) / 10^6 = 21961
> power_b_mW = (100 * 605mW * 605mW * 600MHz) / 10^9 = 21
> 
> max_freq = 2000MHz
> 
> cost_a_mW = 18 * 2000MHz/500MHz = 72
> cost_a_uW = 18000 * 2000MHz/500MHz = 72000
> 
> cost_b_mW = 21 * 2000MHz/600MHz = 70 // <- artificially better
> cost_b_uW = 21961 * 2000MHz/600MHz = 73203
> 
> The 'cost_b_mW' (which is based on old milli-Watts) is misleadingly
> better that the 'cost_b_uW' (this patch uses micro-Watts) and such
> would have impact on the 'inefficient OPPs' information in the Cpufreq
> framework. This patch set removes the rounding issue.
> 
> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>



-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-07-07  8:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07  7:15 [PATCH v2 0/4] Energy Model power in micro-Watts and SCMI v3.1 alignment Lukasz Luba
2022-07-07  7:15 ` [PATCH v2 1/4] PM: EM: convert power field to micro-Watts precision and align drivers Lukasz Luba
2022-07-07  8:31   ` Daniel Lezcano [this message]
2022-07-07 10:44     ` Lukasz Luba
2022-07-07 10:53   ` Viresh Kumar
2022-07-07 10:53     ` Lukasz Luba
2022-07-07  7:15 ` [PATCH v2 2/4] Documentation: EM: Switch to micro-Watts scale Lukasz Luba
2022-07-07  7:15 ` [PATCH v2 3/4] firmware: arm_scmi: Get detailed power scale from perf Lukasz Luba
2022-07-07  7:15 ` [PATCH v2 4/4] cpufreq: scmi: Support the power scale in micro-Watts in SCMI v3.1 Lukasz Luba
2022-07-07 10:52   ` Viresh Kumar
2022-07-07 10:46 ` [PATCH v2 0/4] Energy Model power in micro-Watts and SCMI v3.1 alignment Lukasz Luba
2022-07-15  8:56   ` Lukasz Luba
2022-07-15 17:18     ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b4bd8b5-d5d9-7f75-128a-87b727ad0bd7@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=amitk@kernel.org \
    --cc=cristian.marussi@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=nm@ti.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=sboyd@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).