From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>, 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 09:36:45 -0800 [thread overview]
Message-ID: <8d3a9644657c8f0b54dd272fe0a4d640a8a6dfb9.camel@linux.intel.com> (raw)
In-Reply-To: <de6a5000-260e-bb4a-31c4-a0cfe533fad4@linaro.org>
Hi Daniel,
On Thu, 2022-12-22 at 10:50 +0100, Daniel Lezcano wrote:
>
> 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 ?
Good question.
Calling driver knows what idle_duration he set.
In my first version, I passed *idle_duration (with current
idle_duration set), so the caller can change this for the current
play_idle call if required for one time.
But in powerclamp case we either skip the whole play_idle or not. It
doesn't change idle duration. So didn't add.
But we can add this back.
Thanks,
Srinivas
>
>
next prev parent reply other threads:[~2022-12-22 17:36 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
2022-12-22 17:36 ` srinivas pandruvada [this message]
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=8d3a9644657c8f0b54dd272fe0a4d640a8a6dfb9.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rui.zhang@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).