From: Chris Down <chris@chrisdown.name>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-pm@vger.kernel.org, "Rafael J. Wysocki" <rafael@kernel.org>,
Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
Guenter Roeck <linux@roeck-us.net>
Subject: Re: Thermal notifications without setting thermal governor to userspace?
Date: Mon, 4 Apr 2022 21:50:01 +0100 [thread overview]
Message-ID: <YktZ+ebgm0TzU/qL@chrisdown.name> (raw)
In-Reply-To: <e9d0f787-b23e-1266-c31a-60f9c1643a10@linaro.org>
Daniel Lezcano writes:
>On 04/04/2022 19:17, Chris Down wrote:
>>Daniel Lezcano writes:
>>>Well on regular desktop, the thermal is managed under the hood by
>>>the firmware/hardware, few sensors are exported AFAICT. I don't
>>>think a thermal daemon would have a benefit on these platforms.
>>
>>Maybe we have different expectations? On my laptop, a Thinkpad T14s,
>>things seem not too bad:
>
>That is not a desktop but a laptop, it is different :)
Oh, I see :-) I misread the distinction as embedded vs. consumer-facing.
>Can you give the content of:
>
>cat /sys/class/thermal/thermal_zone*/type
>cat /sys/class/thermal/thermal_zone*/trip_*type
>
>and
>
>cat /sys/class/thermal/cooling_device*/type
% grep . /sys/class/thermal/thermal_zone*/type
/sys/class/thermal/thermal_zone0/type:acpitz
/sys/class/thermal/thermal_zone1/type:INT3400 Thermal
/sys/class/thermal/thermal_zone2/type:SEN1
/sys/class/thermal/thermal_zone3/type:SEN2
/sys/class/thermal/thermal_zone4/type:TCPU
/sys/class/thermal/thermal_zone5/type:iwlwifi_1
/sys/class/thermal/thermal_zone6/type:x86_pkg_temp
% grep . /sys/class/thermal/thermal_zone*/trip_*type
/sys/class/thermal/thermal_zone0/trip_point_0_type:critical
/sys/class/thermal/thermal_zone2/trip_point_0_type:critical
/sys/class/thermal/thermal_zone2/trip_point_1_type:hot
/sys/class/thermal/thermal_zone2/trip_point_2_type:passive
/sys/class/thermal/thermal_zone3/trip_point_0_type:critical
/sys/class/thermal/thermal_zone3/trip_point_1_type:hot
/sys/class/thermal/thermal_zone3/trip_point_2_type:passive
/sys/class/thermal/thermal_zone4/trip_point_0_type:critical
/sys/class/thermal/thermal_zone4/trip_point_1_type:hot
/sys/class/thermal/thermal_zone4/trip_point_2_type:passive
/sys/class/thermal/thermal_zone5/trip_point_0_type:passive
/sys/class/thermal/thermal_zone5/trip_point_1_type:passive
/sys/class/thermal/thermal_zone5/trip_point_2_type:passive
/sys/class/thermal/thermal_zone5/trip_point_3_type:passive
/sys/class/thermal/thermal_zone5/trip_point_4_type:passive
/sys/class/thermal/thermal_zone5/trip_point_5_type:passive
/sys/class/thermal/thermal_zone5/trip_point_6_type:passive
/sys/class/thermal/thermal_zone5/trip_point_7_type:passive
/sys/class/thermal/thermal_zone6/trip_point_0_type:passive
/sys/class/thermal/thermal_zone6/trip_point_1_type:passive
% grep . /sys/class/thermal/cooling_device*/type
/sys/class/thermal/cooling_device0/type:Processor
/sys/class/thermal/cooling_device1/type:Processor
/sys/class/thermal/cooling_device2/type:Processor
/sys/class/thermal/cooling_device3/type:Processor
/sys/class/thermal/cooling_device4/type:Processor
/sys/class/thermal/cooling_device5/type:Processor
/sys/class/thermal/cooling_device6/type:Processor
/sys/class/thermal/cooling_device7/type:Processor
/sys/class/thermal/cooling_device8/type:intel_powerclamp
/sys/class/thermal/cooling_device9/type:TCC Offset
>
>?
>
>
>> % printf '%s\n' /sys/class/hwmon/hwmon*/temp*_input
>> /sys/class/hwmon/hwmon1/temp1_input
>> /sys/class/hwmon/hwmon2/temp1_input
>> /sys/class/hwmon/hwmon2/temp2_input
>> /sys/class/hwmon/hwmon2/temp3_input
>> /sys/class/hwmon/hwmon4/temp1_input
>> /sys/class/hwmon/hwmon4/temp2_input
>> /sys/class/hwmon/hwmon4/temp3_input
>> /sys/class/hwmon/hwmon4/temp4_input
>> /sys/class/hwmon/hwmon4/temp5_input
>> /sys/class/hwmon/hwmon4/temp6_input
>> /sys/class/hwmon/hwmon4/temp7_input
>> /sys/class/hwmon/hwmon4/temp8_input
>> /sys/class/hwmon/hwmon6/temp1_input
>> /sys/class/hwmon/hwmon8/temp1_input
>> /sys/class/hwmon/hwmon8/temp2_input
>> /sys/class/hwmon/hwmon8/temp3_input
>> /sys/class/hwmon/hwmon8/temp4_input
>> /sys/class/hwmon/hwmon8/temp5_input
>>
>>There are working temperature sensors out of the box for the CPU,
>>wifi card, ACPI thermal zone, and extended sensors from
>>thinkpad_acpi.
>>
>>In my case, I'd like to get notifications in userspace when certain
>>temperatures are reached.
>>
>>So if I understood correctly, there's no way to dynamically
>>configure temperature thresholds and get breach events even as root,
>>even with the new netlink solution?
>
>There is a way but you need:
>
>1. A programmable trip point
>
>
>https://uefi.org/specs/ACPI/6.4/11_Thermal_Management/thermal-control.html#dynamically-changing-cooling-temperature-trip-points
>
>1.1 A passive trip point dedicated for userspace (no cooling device
>associated)
>
>1.2 Writable kernel config option
>
>The trip point will be writable in sysfs
>
>2. Get trip point crossed
>
>Use the netlink
>
>But you don't need to monitor all these thermal zones, it is up to the
>in-kernel thermal framework to deal with the trip point individually
>and protect the system.
>
>The userspace should monitor what is considered as the 'case' sensor
>or 'skin' sensor. The temperature on those sensor moves very slowly,
>so monitoring them by getting the temperature every second should be
>enough.
I see. I suspect this is probably too much to get from a distro kernel and
myriad hardware, so I guess I'm consigned to using polling for the timebeing
then.
Thanks a lot for chiming in with your knowledge :-)
Chris
prev parent reply other threads:[~2022-04-04 21:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-30 15:45 Thermal notifications without setting thermal governor to userspace? Chris Down
2022-03-30 18:08 ` Daniel Lezcano
2022-03-30 18:11 ` Chris Down
2022-03-30 22:24 ` Daniel Lezcano
2022-04-04 15:17 ` Chris Down
2022-04-04 16:17 ` Daniel Lezcano
2022-04-04 17:17 ` Chris Down
2022-04-04 20:27 ` Daniel Lezcano
2022-04-04 20:50 ` Chris Down [this message]
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=YktZ+ebgm0TzU/qL@chrisdown.name \
--to=chris@chrisdown.name \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@roeck-us.net \
--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).