From: Hans de Goede <hdegoede@redhat.com>
To: Elia Devito <eliadevito@gmail.com>,
Mark Pearson <markpearson@lenovo.com>,
Bastien Nocera <hadess@hadess.net>,
Mark Pearson <mpearson@lenovo.com>,
Benjamin Berg <bberg@redhat.com>
Cc: Jared Dominguez <jaredz@redhat.com>,
platform-driver-x86@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [External] Re: RFC: offering a standardized (/sys/class) userspace API for selecting system/laptop performance-profiles
Date: Tue, 22 Sep 2020 12:43:11 +0200 [thread overview]
Message-ID: <79735e10-6dfc-ffff-5b42-b78e19e24d9b@redhat.com> (raw)
In-Reply-To: <9766663.nUPlyArG6x@pce>
Hi,
On 9/21/20 11:03 AM, Elia Devito wrote:
> Hi all, sorry for response delay I'm very busy at work this period
No problem.
> A common interface is surely the best solution, especially because it allows
> to standardize the user-space tools and maybe to integrate its with desktop,
> like Bastien is doing with gnome-power-profiles-daemon or like the similar tool
> plasma-pstate.
>
> I think we should keep separate performance and thermal profiles thus leaving
> the possibility of setting a thermal profile independently of the performance
> profile and vice versa.
>
> Hp implements up to 4 thermal profiles (apparently the same ones that implement
> dell), my patch implements the first 3 profiles which are the ones supported by
> my hardware.
>
> 1. HP Recommended -> fan stay off and start at low~medium speed when necessary
> 2. Performance -> fan stay off and start at medium~hight speed when
> necessary
> 3. Cool -> fan stay off and start at medium~hight speed when
> necessary
> 4. Quiet -> fan should stay off and start at very low speed if
> necessary
>
> for each profile the firmware set also a OEM variable to select DPTF profile
> with the adeguate power limit.
>
> combining these profiles with the performance profiles it is possible to obtain
> the desired performance according to the needs of the moment
>
> e.g.
>
> For gaming purpose when the CPU and GPU share the thermal budget, in this case
> the best solution is to set thermal profile to performance to maximize the heat
> dissipation and the p-state profile to powersave, in this way during loadings
> the cpu gain a performance boost that allow to reduce loading time, instead,
> during gameplay the cpu performance will be limited in favor of the GPU
> allowing the maximum framerate to be reached.
> (feral had to handle it for its gamemode tool:
> https://github.com/FeralInteractive/gamemode/pull/179)
>
> Another opposed particular case could be thermal profile set to quiet and
> p-state set to performance, usefull for example to maximizze cpu performance
> in silent ambient room like a library, obviously for CPU-only intesive tasks
> the best solution is to set either thermal and performance profile to
> performance.
>
> Basically there are infinite combinations that can be made to obtain the best
> configuration for each situation, to allow this a common interface should offer
> a possibility to:
>
> - Define the list of thermal profiles separately from the performance ones
> - Eventually define a list of on/off attributes (useful for lenovo lap_mode?)
> - Provide a description of them
> - Switching between thermal profiles regardless of the performance profile
>
> A possible solution could be a "slider like" interface for performance level
> and a list of thermal profile.
So I have been thinking about this and performance level and thermal profile
are really inherently couple to each other. Telling the CPU it can use
25W TPD instead of the default 15W, without also ramping up the cooling is
just going to lead to a whole bunch of thermal throttling.
In a desktop machine with a discrete GPU it is sorta easy, in essence you have
a GPU performance profile, controlling GPU TPD/turbo behavior and the GPU
fans too match, and a CPU performance profile which likewise controls
the CPU fan profile too match the CPU performance profile.
With laptops with a discrete GPU things become harder because there is a
single shared cooling mechanism. But there you could simply say that
performance-profile = max(gpu-profile, cpu-profile).
I mean telling the GPU and CPU that they can burn a gazillion watts and
then telling the cooling setup to be as quiet as possible, is clearly
not going to end well.
This all assumes that we have some nice way to tell the hardware about
the 3 separate (gpu / cpu / cooling) profiles we want.
But that is not always the case; and often when using a CPU with
integrated GPU they are all tied together.
So my proposal is to have a :
/sys/class/performance-profile
Underneath we can have one or more entries (performance-profile providers)
each one with a performance_level file on the previously suggested 0-100 scale
and a performance_mappings file listing the supported discrete values on that
scale and some descriptions of those discrete values purely for informational
purposes.
Besides the performance_level and performance_mappings files I would also like
to add a "type" sysfs attribute, which can have 1 of 3 values:
"system", "cpu" and "gpu".
So something like the thinkpad_acpi performance levels will be "system", and
the intel_pstate driver could maybe also register itself here as a "cpu"
type performance-profile provider.
This will allow userspace (if / when it wants to) to do things like put the
CPU in medium/balanced mode while telling the GPU to go full-throttle for when
playing a game which is clearly GPU limited.
This game scenario of course assumes that we then actually will have a
performance-profile driver for both the CPU and the GPU.
Note I'm still just brainstorming here, but I think that having the
0-100 scale + the type thing should cover all the use-cases we want
to cover.
As always feedback or alternative API proposals are very much welcome.
Regards,
Hans
next prev parent reply other threads:[~2020-09-22 10:43 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-17 11:22 RFC: offering a standardized (/sys/class) userspace API for selecting system/laptop performance-profiles Hans de Goede
2020-09-17 11:50 ` Bastien Nocera
2020-09-17 12:51 ` Hans de Goede
2020-09-17 13:00 ` Bastien Nocera
2020-09-17 13:50 ` Benjamin Berg
2020-09-17 13:54 ` Hans de Goede
2020-09-17 14:10 ` Benjamin Berg
2020-09-17 16:58 ` [External] " Mark Pearson
2020-09-17 17:03 ` Hans de Goede
2020-09-17 17:16 ` Mark Pearson
2020-09-17 18:16 ` Benjamin Berg
2020-09-21 9:03 ` Elia Devito
2020-09-22 10:43 ` Hans de Goede [this message]
2020-09-24 2:10 ` Mark Pearson
2020-09-24 8:21 ` Hans de Goede
2020-09-24 11:48 ` Benjamin Berg
2020-09-22 10:30 ` Hans de Goede
2020-09-24 1:44 ` Mark Pearson
2020-09-17 13:36 ` Mark Pearson
2020-09-17 14:04 ` Hans de Goede
2020-09-17 16:51 ` Mark Pearson
2020-09-17 12:22 ` Benjamin Berg
2020-09-17 12:45 ` Hans de Goede
2020-09-17 13:07 ` Bastien Nocera
2020-09-17 13:46 ` Hans de Goede
2020-09-17 13:02 ` Barnabás Pőcze
2020-09-17 13:24 ` Hans de Goede
2020-09-17 13:28 ` Bastien Nocera
2020-09-17 13:51 ` Hans de Goede
2020-09-17 13:59 ` Benjamin Berg
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=79735e10-6dfc-ffff-5b42-b78e19e24d9b@redhat.com \
--to=hdegoede@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bberg@redhat.com \
--cc=eliadevito@gmail.com \
--cc=hadess@hadess.net \
--cc=jaredz@redhat.com \
--cc=markpearson@lenovo.com \
--cc=mpearson@lenovo.com \
--cc=platform-driver-x86@vger.kernel.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