Different CPU temperatures reported by hw.acpi.thermal.tz0.temperature and dev.pchtherm.0.temperature

  • Thread starter Thread starter Deleted member 65953
  • Start date Start date
D

Deleted member 65953

Guest
hw.acpi.thermal.tz0.temperature and dev.pchtherm.0.temperature report different temperatures on my computer that is running FreeBSD 13.2:

Code:
# sysctl -a | grep temperature
hw.acpi.thermal.tz0.temperature: 27.9C
dev.pchtherm.0.temperature: 42.0C

Why are the results different? Which one provides the real CPU temperature?
 
  • Like
Reactions: mro
If you only wanted to read CPU temperature of more or less modern Intel CPU, load the coretemp kernel module, coretemp(4) or amdtemp for AMD CPUs, amdtemp(4)
Check the manpages for the relevant sysctl values.
hw.acpi.thermal.tz0.temperature is to my knowledge, only a sensor that sits below the CPU on the motherboard (not on-die) and the values do not reflect the real CPU temperature anyway.

acpi_thermal()
pchtherm()


✅ dev.pchtherm.0.temperature: 42.0C

Not very technical information, but definitely information that is there.
 
hw.acpi.thermal.tz0.temperature and dev.pchtherm.0.temperature report different temperatures on my computer that is running FreeBSD 13.2:

What sort of computer? The first few lines of #dmesg after 'BOOT' might be helpful.

Code:
# sysctl -a | grep temperature
hw.acpi.thermal.tz0.temperature: 27.9C
dev.pchtherm.0.temperature: 42.0C

Why are the results different? Which one provides the real CPU temperature?

ACPI thermal zones are commonly sensors on heatsinks, perhaps CPU or CPU+GPU on laptops, and are typically much cooler than on-die CPU sensors like coretemp or the newer pchtherm.

What says all of sysctl dev.pchtherm.0?
 
The first few lines of #dmesg after 'BOOT' might be helpful.
What does that mean? The string "BOOT" never appears in my output of the dmesg command.

ACPI thermal zones are commonly sensors on heatsinks, perhaps CPU or CPU+GPU on laptops, and are typically much cooler than on-die CPU sensors like coretemp or the newer pchtherm.

I have been monitoring the value of hw.acpi.thermal.tz0.temperature for over 12 hours at 5 minute intervals using sysutils/munin-master and sysutils/munin-node. Interestingly, its value is a constant 27.9C during the 12+ hours. In contrast, dev.pchtherm.0.temperature varied between 39.0C and 45.0C over the same period. I think the constant value of hw.acpi.thermal.tz0.temperature is suspect because the computer room's temperature noticeably varies by 5-10 °C between daytime and nighttime.

What says all of sysctl dev.pchtherm.0?

Code:
# sysctl dev.pchtherm.0
dev.pchtherm.0.ctt: 120.0C
dev.pchtherm.0.temperature: 44.0C
dev.pchtherm.0.t2temp: 114.0C
dev.pchtherm.0.t1temp: 111.0C
dev.pchtherm.0.t0temp: 108.0C
dev.pchtherm.0.pmtime: 32
dev.pchtherm.0.pmtemp: 77.0C
dev.pchtherm.0.%parent: pci0
dev.pchtherm.0.%pnpinfo: vendor=0x8086 device=0x06f9 subvendor=0x103c subdevice=0x870c class=0x118000
dev.pchtherm.0.%location: slot=18 function=0 dbsf=pci0:0:18:0
dev.pchtherm.0.%driver: pchtherm
dev.pchtherm.0.%desc: CometLake-H Thermal Subsystem
 
What does that mean? The string "BOOT" never appears in my output of the dmesg command.

Ah, right. Likely scrolled out of the buffer by now. Better see /var/run/dmesg.boot which contains (at least) the most recent "---<<BOOT>>---" initiator, and possibly more.

It's actually 'CPU: ' lines that may be of interest, what model / generation it is ... not for me, but others with more modern kit.

I have been monitoring the value of hw.acpi.thermal.tz0.temperature for over 12 hours at 5 minute intervals using sysutils/munin-master and sysutils/munin-node. Interestingly, its value is a constant 27.9C during the 12+ hours. In contrast, dev.pchtherm.0.temperature varied between 39.0C and 45.0C over the same period. I think the constant value of hw.acpi.thermal.tz0.temperature is suspect because the computer room's temperature noticeably varies by 5-10 °C between daytime and nighttime.

It's possible that temp inside the case could remain fairly constant if TZ0 controlled a case fan by inside temp, but that constant sounds unlikely. You could try with case open?

What says sysctl hw.acpi.thermal.tz0?

Code:
# sysctl dev.pchtherm.0
dev.pchtherm.0.ctt: 120.0C
dev.pchtherm.0.temperature: 44.0C
dev.pchtherm.0.t2temp: 114.0C
dev.pchtherm.0.t1temp: 111.0C
dev.pchtherm.0.t0temp: 108.0C
dev.pchtherm.0.pmtime: 32
dev.pchtherm.0.pmtemp: 77.0C
dev.pchtherm.0.%parent: pci0
dev.pchtherm.0.%pnpinfo: vendor=0x8086 device=0x06f9 subvendor=0x103c subdevice=0x870c class=0x118000
dev.pchtherm.0.%location: slot=18 function=0 dbsf=pci0:0:18:0
dev.pchtherm.0.%driver: pchtherm
dev.pchtherm.0.%desc: CometLake-H Thermal Subsystem

Wow, 120°C critical, that's HOT! Anyway, yours is running cool, and doesn't even get nervous enough below 77° to check more often than 32s.
 
It's actually 'CPU: ' lines that may be of interest, what model / generation it is ... not for me, but others with more modern kit.

Below is the first ~125 lines of output from dmesg. Could the ACPI error ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - PV1D (20201113/dspkginit-605) be the cause of the constant 27.9C value of hw.acpi.thermal.tz0.temperature?

Code:
# dmesg
Copyright (c) 1992-2021 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
    The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.2-RELEASE-p4 GENERIC amd64
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
VT(efifb): resolution 1920x1080
CPU: Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz (3100.00-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0xa0653  Family=0x6  Model=0xa5  Stepping=3
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x7ffafbff<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
  AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
  AMD Features2=0x121<LAHF,ABM,Prefetch>
  Structured Extended Features=0x29c67af<FSGSBASE,TSCADJ,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,NFPUSG,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PROCTRACE>
  Structured Extended Features2=0x40000000<SGXLC>
  Structured Extended Features3=0xbc000400<MD_CLEAR,IBPB,STIBP,L1DFL,ARCH_CAP,SSBD>
  XSAVE Features=0xf<XSAVEOPT,XSAVEC,XINUSE,XSAVES>
  IA32_ARCH_CAPS=0xc2b<RDCL_NO,IBRS_ALL,SKIP_L1DFL_VME,MDS_NO>
  VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID,VID,PostIntr
  TSC: P-state invariant, performance statistics
real memory  = 8589934592 (8192 MB)
avail memory = 8072720384 (7698 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: <HPQOEM 870C    >
FreeBSD/SMP: Multiprocessor System Detected: 12 CPUs
FreeBSD/SMP: 1 package(s) x 6 core(s) x 2 hardware threads
random: registering fast source Intel Secure Key RNG
random: fast provider: "Intel Secure Key RNG"
random: unblocking device.
ioapic0 <Version 2.0> irqs 0-119
Launching APs: 1 3 9 7 5 11 2 10 4 6 8
random: entropy device external interface
kbd1 at kbdmux0
efirtc0: <EFI Realtime Clock>
efirtc0: registered as a time-of-day clock, resolution 1.000000s
smbios0: <System Management BIOS> at iomem 0xc2f66000-0xc2f6601e
smbios0: Version: 3.2, BCD Revision: 3.2
aesni0: <AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS>
acpi0: <HPQOEM SLIC-BPC>
ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - PV1D (20201113/dspkginit-605)
ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - PV06 (20201113/dspkginit-605)
ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - PV01 (20201113/dspkginit-605)
ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - PV13 (20201113/dspkginit-605)
ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - PV09 (20201113/dspkginit-605)
ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - PV0D (20201113/dspkginit-605)
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 24000000 Hz quality 950
Event timer "HPET" frequency 24000000 Hz quality 350
Event timer "HPET1" frequency 24000000 Hz quality 340
Event timer "HPET2" frequency 24000000 Hz quality 340
Event timer "HPET3" frequency 24000000 Hz quality 340
Event timer "HPET4" frequency 24000000 Hz quality 340
Event timer "HPET5" frequency 24000000 Hz quality 340
Event timer "HPET6" frequency 24000000 Hz quality 340
Event timer "HPET7" frequency 24000000 Hz quality 340
atrtc0: <AT realtime clock> port 0x70-0x77 irq 8 on acpi0
atrtc0: Warning: Couldn't map I/O.
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
attimer0: <AT timer> port 0x40-0x43,0x50-0x53 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1808-0x180b on acpi0
acpi_ec0: <Embedded Controller: GPE 0x6e> port 0x62,0x66 on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
vgapci0: <VGA-compatible display> port 0x3000-0x303f mem 0xe0000000-0xe0ffffff,0xd0000000-0xdfffffff at device 2.0 on pci0
vgapci0: Boot video device
xhci0: <XHCI (generic) USB 3.0 controller> mem 0xe1120000-0xe112ffff at device 20.0 on pci0
xhci0: 32 bytes context size, 64-bit DMA
usbus0 on xhci0
usbus0: 5.0Gbps Super Speed USB v3.0
pci0: <memory, RAM> at device 20.2 (no driver attached)
pci0: <network> at device 20.3 (no driver attached)
pci0: <simple comms> at device 22.0 (no driver attached)
pci0: <simple comms, UART> at device 22.3 (no driver attached)
ahci0: <AHCI SATA controller> port 0x3080-0x3087,0x3090-0x3093,0x3060-0x307f mem 0xe1134000-0xe1135fff,0xe113a000-0xe113a0ff,0xe1139000-0xe11397ff at device 23.0 on pci0
ahci0: AHCI v1.31 with 4 6Gbps ports, Port Multiplier not supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich3: <AHCI channel> at channel 3 on ahci0
ahciem0: <AHCI enclosure management bridge> on ahci0
pcib1: <ACPI PCI-PCI bridge> at device 27.0 on pci0
pci1: <ACPI PCI bus> on pcib1
nvme0: <Generic NVMe Device> mem 0xe1000000-0xe1003fff,0xe1004000-0xe10040ff at device 0.0 on pci1
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
pci0: <serial bus> at device 31.5 (no driver attached)
em0: <Intel(R) I219-LM CMP(11)> mem 0xe1100000-0xe111ffff at device 31.6 on pci0
em0: EEPROM V0.4-4
em0: Using 1024 TX descriptors and 1024 RX descriptors
em0: Using an MSI interrupt
em0: Ethernet address: 5c:60:ba:36:e9:0a
em0: netmap queues/slots: TX 1/1024, RX 1/1024
acpi_button0: <Sleep Button> on acpi0
acpi_button1: <Power Button> on acpi0
acpi_tz0: <Thermal Zone> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
acpi_syscontainer0: <System Container> on acpi0
acpi_syscontainer1: <System Container> on acpi0
hwpstate_intel0: <Intel Speed Shift> on cpu0
hwpstate_intel1: <Intel Speed Shift> on cpu1
hwpstate_intel2: <Intel Speed Shift> on cpu2
hwpstate_intel3: <Intel Speed Shift> on cpu3
hwpstate_intel4: <Intel Speed Shift> on cpu4
hwpstate_intel5: <Intel Speed Shift> on cpu5
hwpstate_intel6: <Intel Speed Shift> on cpu6
hwpstate_intel7: <Intel Speed Shift> on cpu7
hwpstate_intel8: <Intel Speed Shift> on cpu8
hwpstate_intel9: <Intel Speed Shift> on cpu9
hwpstate_intel10: <Intel Speed Shift> on cpu10
hwpstate_intel11: <Intel Speed Shift> on cpu11
Timecounter "TSC-low" frequency 1548003145 Hz quality 1000
Timecounters tick every 1.000 msec
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
ugen0.1: <Intel XHCI root HUB> at usbus0
uhub0 on usbus0
uhub0: <Intel XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
...

What says sysctl hw.acpi.thermal.tz0?

Here is the full output:
Code:
# sysctl hw.acpi.thermal.tz0
hw.acpi.thermal.tz0._TSP: 600
hw.acpi.thermal.tz0._TC2: 0
hw.acpi.thermal.tz0._TC1: 0
hw.acpi.thermal.tz0._ACx: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
hw.acpi.thermal.tz0._CRT: -1
hw.acpi.thermal.tz0._HOT: -1
hw.acpi.thermal.tz0._PSV: 20.1C
hw.acpi.thermal.tz0.thermal_flags: 1
hw.acpi.thermal.tz0.passive_cooling: 1
hw.acpi.thermal.tz0.active: -1
hw.acpi.thermal.tz0.temperature: 27.9C
 
Below is the first ~125 lines of output from dmesg. Could the ACPI error ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - PV1D (20201113/dspkginit-605) be the cause of the constant 27.9C value of hw.acpi.thermal.tz0.temperature?

I doubt it, but can't find any reference to that error. Some AE_NOT_FOUND notifications are fairly common and can mostly be ignored if not allied to real problem symptoms, as $googling shows.

ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - PV1D (20201113/dspkginit-605)

There are 6 of these, one per CPU (not thread). Possibly the latest ACPICA hasn't caught up with later "*Lake" CPUs, or that system's ACPI has bug/s, not uncommon. I wouldn't worry unless some real issue arises.

Here is the full output:
Code:
# sysctl hw.acpi.thermal.tz0
hw.acpi.thermal.tz0._TSP: 600
hw.acpi.thermal.tz0._TC2: 0
hw.acpi.thermal.tz0._TC1: 0
hw.acpi.thermal.tz0._ACx: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
hw.acpi.thermal.tz0._CRT: -1
hw.acpi.thermal.tz0._HOT: -1
hw.acpi.thermal.tz0._PSV: 20.1C
hw.acpi.thermal.tz0.thermal_flags: 1
hw.acpi.thermal.tz0.passive_cooling: 1
hw.acpi.thermal.tz0.active: -1
hw.acpi.thermal.tz0.temperature: 27.9C

Passive cooling (ie CPU speed moderation for temperature) is enabled but not active, despite temperature above _PSV (see sysctl -d for descriptions).

Makes no sense to me, but might be related to the Speed Shift business.

Without problem symptoms I wouldn't worry about it. The best diagnostic instrument for temperatures is a finger.
 
Better see /var/run/dmesg.boot which contains (at least) the most recent "---<<BOOT>>---" initiator, and possibly more.
The "---<<BOOT>>---" string appears in my /var/log/messages but not in /var/run/dmesg.boot.
 
The "---<<BOOT>>---" string appears in my /var/log/messages but not in /var/run/dmesg.boot.

Unless this has changed between 12.x and 13.x, I expect that the size of your /var/run/dmesg.boot exceeds [edit] or rather would exceed [/edit] the value of sysctl kern.msgbufsize.

If so, you could add (perhaps) kern.msgbufsize=114688 to /boot/loader.conf

Nothing wrong with referring to /var/log/messages of course; point being the first messages of the boot.
 
Back
Top