[PATCH v10 17/17] Documentation/filesystems/resctrl: Document telemetry mount timing caveat

From: Tony Luck

Date: Wed Jul 29 2026 - 15:06:43 EST


The PMT driver enumerates telemetry features asynchronously, so an
automatic mount of resctrl from /etc/fstab early in boot may occur before
those features are available, resulting in them not being enabled in the
mounted instance.

Add a footnote to the 'If telemetry monitoring is enabled' sentence
pointing readers to a new "Mounting resctrl with telemetry" section. That
section explains the race and provides example systemd service and udev
rule snippets that defer the mount until after the pmt_telemetry module
has loaded.

Assisted-by: Claude:Opus_4.7
Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
---
v10:
Unchanged since v9

Documentation/filesystems/resctrl.rst | 60 ++++++++++++++++++++++++++-
1 file changed, 59 insertions(+), 1 deletion(-)

diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesystems/resctrl.rst
index e4b66af55ffb..260a5eef675f 100644
--- a/Documentation/filesystems/resctrl.rst
+++ b/Documentation/filesystems/resctrl.rst
@@ -630,7 +630,7 @@ When monitoring is enabled all MON groups will also contain:
each instance of an L3 cache. Each directory contains files for the enabled
L3 events (e.g. "llc_occupancy", "mbm_total_bytes", and "mbm_local_bytes").

- If telemetry monitoring is enabled, there will be a "mon_PERF_PKG_YY"
+ If telemetry monitoring is enabled [#]_, there will be a "mon_PERF_PKG_YY"
directory for each physical processor package. Each directory contains
files for the enabled telemetry events (e.g. "core_energy". "activity",
"uops_retired", etc.)
@@ -669,6 +669,10 @@ When monitoring is enabled all MON groups will also contain:
returned if the MBM event does not have an assigned counter in the
CTRL_MON group nor in any of its associated MON groups.

+.. [#] Telemetry features are enumerated asynchronously by the PMT driver, so
+ an automatic mount of resctrl from ``/etc/fstab`` at boot may not enable
+ them. See `Mounting resctrl with telemetry`_ below.
+
"mon_hw_id":
Available only with debug option. The identifier used by hardware
for the monitor group. On x86 this is the RMID.
@@ -1898,6 +1902,60 @@ m. Unmount the resctrl filesystem.

# umount /sys/fs/resctrl/

+Mounting resctrl with telemetry
+===============================
+
+Telemetry features (e.g. the ``mon_PERF_PKG_YY`` events) are enumerated
+asynchronously by the PMT driver. If resctrl is mounted before that
+enumeration completes - for example, when mounted automatically from
+``/etc/fstab`` early in boot - the telemetry features will not be available
+at mount time and will therefore not be enabled in the mounted instance.
+
+To avoid this race, defer the mount until after the ``pmt_telemetry`` module
+has loaded. One way to do this is with a udev rule that triggers a systemd
+service when the module appears. A tmpfs mount onto /sys/fs/resctrl is
+needed to prevent daemon tasks from obtaining references to the resctrl
+file system in the other name spaces that systemd uses during startup.
+
+Example systemd tmpfs mount service (``/etc/systemd/system/sys-fs-resctrl.mount``)::
+
+ [Unit]
+ Description=Early Resctrl Namespace Firewall
+ DefaultDependencies=no
+ Before=basic.target local-fs.target
+
+ [Mount]
+ What=tmpfs
+ Where=/sys/fs/resctrl
+ Type=tmpfs
+ Options=private,nosuid,nodev,noexec,mode=755
+
+ [Install]
+ WantedBy=sysinit.target
+
+Example systemd service (``/etc/systemd/system/mount-resctrl.service``)::
+
+ [Unit]
+ Description=Mount real resctrl pseudo-filesystem natively
+ DefaultDependencies=no
+ Requires=sys-fs-resctrl.mount
+ After=sys-fs-resctrl.mount
+
+ [Service]
+ Type=oneshot
+ # Pause to let systemd start daemons
+ ExecStart=/usr/bin/sleep 10
+ # Mount the real resctrl file system
+ ExecStart=/usr/bin/mount -t resctrl resctrl /sys/fs/resctrl
+ RemainAfterExit=no
+
+ [Install]
+ WantedBy=multi-user.target
+
+Example udev rule (``/etc/udev/rules.d/99-rmid-telemetry.rules``)::
+
+ SUBSYSTEM=="module", KERNEL=="pmt_telemetry", ACTION=="add", RUN+="/usr/bin/systemctl start mount-resctrl.service"
+
Intel RDT Errata
================

--
2.55.0