From 8e9bd28236e633238a7773c9dd809bd87a4db1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asaf=20Nuri=20Bertizlio=C4=9Flu?= Date: Thu, 15 Oct 2026 20:17:59 +0300 Subject: [PATCH] hwmon: (coretemp) Document sysfs numbering and label meaning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documentation says that all sysfs entries are named with their core_id, and that the "Core X" label contains the processor number. Neither is accurate. create_core_attrs() numbers the per-core attributes core_id + 2 and always uses temp1 for the package sensor, and show_label() prints topology_core_id(), not the logical CPU number. The difference is easy to see on hybrid CPUs. On an i7-14700F, the "Core 4" label is on temp6 and belongs to CPUs 2 and 3, and the E-cores report core IDs 32 to 43. Describe the actual numbering. The mismatch was found by an LLM comparing the documentation with the code, and verified on the i7-14700F above. Assisted-by: LLM Signed-off-by: Asaf Nuri Bertizlioğlu Tested-by: Ximing Zhang Reviewed-by: Ximing Zhang Link: https://patch.msgid.link/20261015171759.704526-1-ycistak@gmail.com Signed-off-by: Guenter Roeck --- Documentation/hwmon/coretemp.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Documentation/hwmon/coretemp.rst b/Documentation/hwmon/coretemp.rst index 09f885a847e3..0cd3438c00ee 100644 --- a/Documentation/hwmon/coretemp.rst +++ b/Documentation/hwmon/coretemp.rst @@ -46,7 +46,8 @@ mechanism will perform actions to forcibly cool down the processor. Alarm may be raised, if the temperature grows enough (more than TjMax) to trigger the Out-Of-Spec bit. The following table summarizes the exported sysfs files: -All sysfs entries are named with their core_id (represented here by 'X'). +Per-core sysfs entries are numbered core_id + 2 (represented here by 'X'). +The package entries, if available, are always temp1_*. ================= ======================================================== tempX_input Core temperature (in millidegrees Celsius). @@ -58,9 +59,12 @@ tempX_max Maximum recommended operating temperature (Tcontrol). tempX_crit Maximum junction temperature (in millidegrees Celsius). tempX_crit_alarm Set when Out-of-spec bit is set, never clears. Correct CPU operation is no longer guaranteed. -tempX_label Contains string "Core X", where X is processor - number. For Package temp, this will be "Package id Y", - where Y is the package number. +tempX_label Contains string "Core N", where N is the core_id + (X - 2), as shown in + /sys/devices/system/cpu/cpu*/topology/core_id. This + is not the logical CPU number, and core_id values + may be sparse. For Package temp, this will be + "Package id Y", where Y is the package number. ================= ======================================================== On modern CPUs (Nehalem and newer), TjMax is read from the