linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Lukasz Luba <lukasz.luba@arm.com>
Cc: rafael@kernel.org, linux-kernel@vger.kernel.org,
	amitk@kernel.org, Chetankumar Mistry <chetan.mistry@arm.com>,
	rui.zhang@intel.com, linux-pm@vger.kernel.org
Subject: Re: [PATCH v2][RFC 1/2] Implement Ziegler-Nichols Heuristic
Date: Thu, 6 Jan 2022 13:16:28 +0100	[thread overview]
Message-ID: <1b6047eb-2f14-ddde-4712-145a26dc8aa5@linaro.org> (raw)
In-Reply-To: <23c3480a-c46b-f049-5758-d11124367190@arm.com>


Hi Lukasz,

On 06/01/2022 12:54, Lukasz Luba wrote:
> Hi Daniel,
> 
> Could you have a look at this, please?

Yes, I had a quick look at the code and went to the algorithm description.

Still digesting ...

> On 12/17/21 6:49 PM, Chetankumar Mistry wrote:
>> Implement the Ziegler-Nichols Heuristic algorithm to better
>> estimate the PID Coefficients for a running platform.
>> The values are tuned to minimuse the amount of overshoot in
>> the temperature of the platform and subsequently minimise
>> the number of switches for cdev states.
>>
>> Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
> 
> 
> This is the continuation of the previous idea to have
> better k_* values. You might remember this conversation [1].
> 
> I've spent some time researching papers how and what can be done
> in this field and if possible to plumb in to the kernel.
> We had internal discussions (~2017) of one method fuzzy-logic that I
> found back then, but died at the begging not fitting into this
> IPA kernel specific environment and user-space. Your suggestion with
> observing undershooting and overshooting results sparked better idea.
> I thought it's worth to invest in it but I didn't have
> time. We are lucky, Chetan was designated to help me and
> experiment/implement/test these ideas and here is the patch set.
> 
> He's chosen the Ziegler-Nichols method, which shows really
> good results in benchmarks (Geekbench and GFXbench on hikey960 Android).
> The improved performance in Geekbench is ~10% (vs. old IPA).

+10% perf improvements sounds great. What about the temperature
mitigation (temp avg + stddev) ?

> The main question from our side is the sysfs interface
> which we could be used to trigger this algorithm for
> better coefficients estimations.
> We ask user to echo to some sysfs files in thermal zone
> and start his/her workload. This new IPA 'learns' the system
> utilization and reaction in temperature. After a few rounds,
> we get better fitted coefficients.
> If you need more background about the code or mechanisms, or tests,
> I'm sure Chetan is happy to provide you those.

I'm worried about the complexity of the algorithm and the overhead implied.

The k_* factors are tied with the system and the thermal setup (fan,
heatsink, processor, opp, ...). So IIUC when the factors are found, they
should not change and could be part of the system setup.

Would the algorithm fit better in a separate userspace kernel tooling?
So we can run it once and find the k_* for a board.

Additionally, the values can be stored in the Documentation for
different board and a documentation on how to use the tool.

Then up to the SoC vendor to setup the k_* in sysfs, so no need to
change any interface.

> If you are interested in those analyses we can find a way to share a> .html file with the results from LISA notebook.

Yes,

> We are waiting for your decision regarding the design and user
> interface.
> 
> Regards,
> Lukasz
> 
> [1]
> https://lore.kernel.org/lkml/42360f0f-5d53-085b-536f-33df93b787ca@arm.com/


-- 
<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-01-06 12:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 18:49 [PATCH v2][RFC 1/2] Implement Ziegler-Nichols Heuristic Chetankumar Mistry
2021-12-17 18:49 ` [PATCH v2][RFC 2/2] Remove sysfs entry Chetankumar Mistry
2021-12-18  6:07 ` [PATCH v2][RFC 1/2] Implement Ziegler-Nichols Heuristic Randy Dunlap
2021-12-20  9:58   ` Lukasz Luba
2022-01-06 11:54 ` Lukasz Luba
2022-01-06 12:16   ` Daniel Lezcano [this message]
2022-01-06 13:16     ` Lukasz Luba
2022-01-07 11:52       ` Daniel Lezcano
2022-01-07 13:39         ` Lukasz Luba
     [not found]           ` <DB6PR0802MB22791E85B333050C801ED388F8299@DB6PR0802MB2279.eurprd08.prod.outlook.com>
2022-02-04 11:50             ` 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=1b6047eb-2f14-ddde-4712-145a26dc8aa5@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=amitk@kernel.org \
    --cc=chetan.mistry@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --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).