linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>,
	rafael@kernel.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	rui.zhang@intel.com, amitk@kernel.org
Subject: Re: [PATCH v2 2/4] powercap: idle_inject: Add prepare/complete callbacks
Date: Thu, 22 Dec 2022 10:50:29 +0100	[thread overview]
Message-ID: <de6a5000-260e-bb4a-31c4-a0cfe533fad4@linaro.org> (raw)
In-Reply-To: <3e59c5216fad003f079224cd08a7da9b30f6365d.camel@linux.intel.com>


Hi Srinivas,


On 21/12/2022 21:58, srinivas pandruvada wrote:
> Hi Daniel,
> 
> On Wed, 2022-12-21 at 15:52 +0100, Daniel Lezcano wrote:
>>
>> Hi Srinivas,
>>
>> On 30/11/2022 00:34, Srinivas Pandruvada wrote:
>>> The actual idle percentage can be less than the desired because of
>>> interrupts. Since the objective for CPU Idle injection is for
>>> thermal
>>> control, there should be some way to compensate for lost idle
>>> percentage.
>>> Some architectures provide interface to get actual idle percent
>>> observed
>>> by the hardware. So, the idle percent can be adjusted using the
>>> hardware
>>> feedback. For example, Intel CPUs provides package idle counters,
>>> which
>>> is currently used by intel powerclamp driver to adjust idle time.
>> Can you provide an example in terms of timings?
>>
>> I'm not getting how 'prepare' would do by returning a positive value
>> to
>> skip the play_idle_precise() and what will do 'complete' ?
>>
> intel_powerclamp has a logic where if the current idle percentage
> observed from hardware is more than the desired target inject percent,
> it skips calling play_idle().
> 
> For example if you want to inject 50% idle and system is naturally idle
> for 60%, there is no use of calling play_idle in the idle injection
> framework to induce more idle. In this way a workload can run
> immediately.
> 
> So trying to emulate the same logic by using powercap/idle_inject
> framework. So prepare() callback in the intel_powerclamp driver calls
> the existing function to check if idle-inject should skip for this time
> or not.

The function 'prepare' has the 'cpu' parameter. How can it compare with 
the desired idle duration as this information is not passed to the 
callback ?


-- 
<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


  reply	other threads:[~2022-12-22  9:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 23:34 [PATCH v2 0/4] Per CPU idle injection Srinivas Pandruvada
2022-11-29 23:34 ` [PATCH v2 1/4] powercap: idle_inject: Export symbols Srinivas Pandruvada
2023-01-12 15:05   ` Rafael J. Wysocki
2022-11-29 23:34 ` [PATCH v2 2/4] powercap: idle_inject: Add prepare/complete callbacks Srinivas Pandruvada
2022-12-21 14:52   ` Daniel Lezcano
2022-12-21 20:58     ` srinivas pandruvada
2022-12-22  9:50       ` Daniel Lezcano [this message]
2022-12-22 17:36         ` srinivas pandruvada
2023-01-12 14:37           ` Rafael J. Wysocki
2023-01-12 14:53   ` Rafael J. Wysocki
2023-01-12 17:25     ` Rafael J. Wysocki
2023-01-12 18:13       ` srinivas pandruvada
2022-11-29 23:34 ` [PATCH v2 3/4] thermal/drivers/intel_powerclamp: Use powercap idle-inject framework Srinivas Pandruvada
2023-01-12 18:32   ` Rafael J. Wysocki
2023-01-12 20:23     ` srinivas pandruvada
2023-01-12 21:03       ` Rafael J. Wysocki
2022-11-29 23:34 ` [PATCH v2 4/4] thermal/drivers/intel_cpu_idle_cooling: Introduce Intel cpu idle cooling driver Srinivas Pandruvada
2022-12-21 15:10   ` Daniel Lezcano

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=de6a5000-260e-bb4a-31c4-a0cfe533fad4@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=amitk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=srinivas.pandruvada@linux.intel.com \
    /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).