From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D538377A95 for ; Wed, 29 Jul 2026 17:28:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785346101; cv=none; b=UtyR69JLrvjTD6Vzsg1swXlb3rjYK7UXlhchwuHIsJVKJJ8GEVrgMn+zSV5tqLmJ2iB5hZ5xz/z8jWUC5trzg+BmXsRzpFZB0lnr/PQmrUW+EmLQVpxDC7zgqlLMXqD9MnIEk/qCh1fdXIQ/RwzCRtZZcgFfvtW/XVZDEcz0yfY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785346101; c=relaxed/simple; bh=aouTX+c58kvWA1zNYOOgOPGa6BhCcpam3sZMxTQ+m3o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lp3+teRUXyYGTbOC2d375PYRoNHi4bDPnNDv7mbMmhXTijlVC+MP5diXgtJWnZ6ZJWpy5LB4CBToO/MhtnpehuV/lqAA9E71jEWBju6KjZQJSs2zpES8N2QaEYioTXVVBxhrbWAmzP5rRoe0SoYOGuFrjSP+0I/wkYyS61+KiBM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=M0SwTLBW; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="M0SwTLBW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1785346097; x=1816882097; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aouTX+c58kvWA1zNYOOgOPGa6BhCcpam3sZMxTQ+m3o=; b=M0SwTLBW+QignWqHBDhn6PwDdU5B5w4nvLAOXvA/9O+fiZ4p5BwcxmzW 5soWGQUblVJMleA9aC5OcKn/T8UgxgtniVpUg6DKlXm93Tu/QilEkrjCj XP+GR7G3B0NDxezBTFXpd2WLAsOmf5QODhX/f2nofDA2+PNSpRvDZSPxQ lQhTWnp2pRjla+uwVXUbZIQNTFgFg629Y7EB0S+iXMDEaLgZJnnH2+o1a ExiBHstVoIHnhqfMeUbqbyJTczrRAGR8mJVobOc7AvhMjrPieJw3cEstM zGarOteb5v0K84i8sdMfnKsj5XtkdHY+YKtT9Z8xfxBRDhbMvi69O87I0 Q==; X-CSE-ConnectionGUID: qgwIpHBHSFGwBH+mFl8s3w== X-CSE-MsgGUID: HbSRIosKR7ipLWFgd2FypA== X-IronPort-AV: E=McAfee;i="6800,10657,11859"; a="97473698" X-IronPort-AV: E=Sophos;i="6.25,192,1779174000"; d="scan'208";a="97473698" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2026 10:28:03 -0700 X-CSE-ConnectionGUID: Sel2bZfnS9WEc7ytwi/Wag== X-CSE-MsgGUID: Y7niryY/RDCyL9anfej8rA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,192,1779174000"; d="scan'208";a="262024627" Received: from iherna2-mobl4.amr.corp.intel.com (HELO agluck-desk3.home.arpa) ([10.124.223.238]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2026 10:28:03 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu , David E Box , x86@kernel.org Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v10 17/17] Documentation/filesystems/resctrl: Document telemetry mount timing caveat Date: Wed, 29 Jul 2026 10:27:52 -0700 Message-ID: <20260729172752.11561-18-tony.luck@intel.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260729172752.11561-1-tony.luck@intel.com> References: <20260729172752.11561-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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