Archive-only list for patches
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: Fenghua Yu <fenghuay@nvidia.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
	Peter Newman <peternewman@google.com>,
	James Morse <james.morse@arm.com>,
	Babu Moger <babu.moger@amd.com>,
	"Drew Fustini" <dfustini@baylibre.com>,
	Dave Martin <Dave.Martin@arm.com>, Chen Yu <yu.c.chen@intel.com>,
	David E Box <david.e.box@intel.com>, <x86@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	<linux-kernel@vger.kernel.org>, <patches@lists.linux.dev>
Subject: Re: [PATCH v10 00/17] Allow AET to use PMT as loadable module
Date: Wed, 29 Jul 2026 13:11:01 -0700	[thread overview]
Message-ID: <ampeVc1SCnnvqu9y@agluck-desk3> (raw)
In-Reply-To: <20260729172752.11561-1-tony.luck@intel.com>

Sashiko review: https://sashiko.dev/#/patchset/20260729172752.11561-1-tony.luck%40intel.com

My responses to issues raised below. In some cases I've clipped just
part of Sashiko response. Use the link above to see the full details
and context for each.

--- Patch [1]: [PATCH v10 01/17] x86/resctrl: Fix enumeration of number of supported RMIDs ---

  "Does this early return introduce a potential division-by-zero during boot ..."

Yes. I need to add this code to the start of get_rdt_mon_resources():

	if (boot_cpu_data.x86_cache_max_rmid < 0)
		return false;

--- Patch 7: [PATCH v10 07/17] arm,x86,fs/resctrl: Handle change in number of RMIDs on each mount ---

  "Does this logic ignore Application Energy Telemetry (AET) if it relies on
   RDT_RESOURCE_PERF_PKG instead of RDT_RESOURCE_L3? 
   If the system supports AET but lacks L3 cache monitoring, x86_cache_max_rmid
   could be less than or equal to 0, causing this function to return 0. 
   Additionally, if the fallback to x86_cache_max_rmid is taken, x86_cache_max_rmid
   represents a maximum index rather than a count. Could this cause an off-by-one 
   under-allocation, since a maximum index of N means there are N + 1 RMIDs?"

First part of this complaint is incorrect. If any monitoring is
supported (including AET) then boot_cpu_data.x86_cache_max_rmid will be
some number greater than zero from cpuid_ebx(0xf).

Second part is correct. I've muddled up the "max index" and the "number
of RMIDs" and need to add one to the max index when allocating data
structures.

  "If resctrl_arch_system_max_rmid_idx() returns 0 for a system with AET but no
   L3 monitoring, won't max_idx_limit be 0, leading to a zero-sized rmid_ptrs
   array?"

Can't happen. See above.

--- Patch 8: [PATCH v10 08/17] x86/resctrl: Enforce system RMID limit on AET event groups ---

  "Does bypassing rdt_get_l3_mon_config() when L3 events are disabled break
   Sub-NUMA Cluster (SNC) detection?"

Yes. But that's the right thing to do. Sub-NUMA Cluster detection is
only needed for the L3 monitor events. If those don't exist (or have
been disabled with clearcpuid) then the full range of RMIDs are
available for use by AET.

  "Will this result in an off-by-one truncation of the AET RMID limit if L3
   monitoring is disabled?"

Yes. One of the places where fix is needed: num_rmids = max_idx + 1

  "This is a pre-existing issue, but could this code encounter a divide-by-zero
   during boot if the maximum RMID index evaluates to 0?"

As above. Maximum RMID index can't be zero.

--- Patch 9: [PATCH v10 09/17] x86/resctrl: Add PMT registration API for AET enumeration callbacks ---

  "Is this description accurate given that CONFIG_X86_CPU_RESCTRL_INTEL_AET in
   Kconfig strictly enforces INTEL_PMT_TELEMETRY=y, preventing it from being
   built as a module?
   Additionally, if that Kconfig dependency were relaxed to allow it to be a
   module, wouldn't it immediately result in a link-time error? It appears
   intel_aet_get_events() still directly calls the exported function
   intel_pmt_get_regions_by_feature() rather than using the new callbacks."

Sashiko doesn't understand that I've broken some parts of this series
into "add some new infrastructure" and then subsequent patches "use that
new infrastructure". At this point in the series Sashiko correctly notes
that the telemetry driver is forced to be built-in. The issue raised
here is fixed by the point in the series that removes the Kconfig
restriction.

  "Do these static variables cause a -Wunused-but-set-variable compiler
   warning that breaks builds when CONFIG_WERROR=y is enabled?
   It appears intel_aet_get_events() was not updated in this patch to use the
   new get_feature callback, leaving these variables unread."

Ditto. Variables used in later patch.

  "Since these variables are assigned here but never read, and the registration
   function intel_aet_register_enumeration() doesn't seem to be called
   anywhere in the kernel, does this leave the variables and function as dead
   code?"

Yup. Dead code now. Gets used in later patch.

--- Patch 10: [PATCH v10 10/17] platform/x86/intel/pmt: Register enumeration functions with resctrl ---

  "The commit message indicates the goal is to allow INTEL_PMT_TELEMETRY to be a
   loadable module while resctrl remains built-in. However, are the callbacks
   registered here actually used by the resctrl subsystem?
   Looking at intel_aet_get_events() and intel_aet_exit() in 
   arch/x86/kernel/cpu/resctrl/intel_aet.c, it appears they still make direct
   calls to the exported PMT functions:"

Another "defined now, used in later patch" issue.

--- Patch 11: [PATCH v10 11/17] arm,x86/resctrl: Resolve INTEL_PMT_TELEMETRY symbols at runtime ---

  "Will the module reference acquired during mount permanently leak?"

At this point in the series the telemetry code is still built-in. So no
leak.

--- Patch 14: [PATCH v10 14/17] x86/resctrl: Export interface to report telemetry unbind/remove ---

  "Is it possible for domid to be 64 or greater when evaluated here?"

This patch is new in the series and I'd like discussion on the approach.
My first internal version used an aggressive approach. If any of the
MMIO regions were unmapped by unbind/remove, then I disabled all AET
event reporting. An AI review said this was overkill, and I should only
disable event counts for the unmapped MMIO regions. So I added this
"per-package" logic. Using a u64 as a bitmap of affected packages seems
like it will handle real systems. But now I need to checks for
theoretical systems with 64 or more packages. Seems like make-work.

--- Patch 15: [PATCH v10 15/17] platform/x86/intel/pmt: Inform resctrl when MMIO maps are being removed ---

  "Does this code safely handle non-PCI telemetry devices?"

No. But there are no such things. All telemetry devices are PCIe with
VSEC enumeration of events.

  "This is a pre-existing issue, but does dropping this kref before unregistering
   the sysfs file create a use-after-free window?"

  "This is also a pre-existing issue, but does removing the PMT device leave
   external consumers vulnerable to accessing unmapped memory?"

I can pass these two pre-existing issues to the telemetry maintainer.


--- Patch 16: [PATCH v10 16/17] x86/resctrl: Simplify Kconfig options for resctrl ---

  "Does using a private mount point here break mount propagation to child mount
   namespaces? This could isolate the final filesystem mount, preventing
   container engines or virtualization daemons from accessing the resctrl
   directory."

Yes. Deliberately so. Those things don't need access. Propagating the
mount to them makes the system harder to manage. Users must use the "-l"
option to umount to get the file system propely unmounted.

  "Will this 10-second sleep inside a oneshot service cause the systemctl start
   command in the udev rule to hang? This appears to synchronously block the udev
   event worker during boot."

I haven't observed a hang. The udev rule seems to be running
asynchronously (on Fedora). The system boot completes, and then
the sleep completes and the filesystem is mounted.

  "Does this rule make the mount entirely dependent on the pmt_telemetry module
   load event?"

I'd expect users to only install this rule on systems that support AET.

I'm open to better suggestions on how to trigger resctrl mount after the telemetry
module loads.

-Tony

      parent reply	other threads:[~2026-07-29 20:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 17:27 [PATCH v10 00/17] Allow AET to use PMT as loadable module Tony Luck
2026-07-29 17:27 ` [PATCH v10 01/17] x86/resctrl: Fix enumeration of number of supported RMIDs Tony Luck
2026-07-29 17:27 ` [PATCH v10 02/17] x86/resctrl: Require 64-bit x86 for resctrl support Tony Luck
2026-07-29 17:27 ` [PATCH v10 03/17] fs/resctrl: Remove redundant calls to resctrl_arch_mon_capable() Tony Luck
2026-07-29 17:27 ` [PATCH v10 04/17] x86/resctrl: Honor rdt=perf option to force enable AET perf events Tony Luck
2026-07-29 17:27 ` [PATCH v10 05/17] fs/resctrl: Add interface to disable a monitor event Tony Luck
2026-07-29 17:27 ` [PATCH v10 06/17] x86/resctrl: Drop global 'rdt_mon_capable' flag Tony Luck
2026-07-29 17:27 ` [PATCH v10 07/17] arm,x86,fs/resctrl: Handle change in number of RMIDs on each mount Tony Luck
2026-07-29 17:27 ` [PATCH v10 08/17] x86/resctrl: Enforce system RMID limit on AET event groups Tony Luck
2026-07-29 17:27 ` [PATCH v10 09/17] x86/resctrl: Add PMT registration API for AET enumeration callbacks Tony Luck
2026-07-29 17:27 ` [PATCH v10 10/17] platform/x86/intel/pmt: Register enumeration functions with resctrl Tony Luck
2026-07-29 17:27 ` [PATCH v10 11/17] arm,x86/resctrl: Resolve INTEL_PMT_TELEMETRY symbols at runtime Tony Luck
2026-07-29 17:27 ` [PATCH v10 12/17] x86/resctrl: Prepare to handle nested mount requests Tony Luck
2026-07-29 17:27 ` [PATCH v10 13/17] fs/resctrl: Call architecture hooks for every mount/unmount Tony Luck
2026-07-29 17:27 ` [PATCH v10 14/17] x86/resctrl: Export interface to report telemetry unbind/remove Tony Luck
2026-07-29 17:27 ` [PATCH v10 15/17] platform/x86/intel/pmt: Inform resctrl when MMIO maps are being removed Tony Luck
2026-07-29 17:27 ` [PATCH v10 16/17] x86/resctrl: Simplify Kconfig options for resctrl Tony Luck
2026-07-29 17:27 ` [PATCH v10 17/17] Documentation/filesystems/resctrl: Document telemetry mount timing caveat Tony Luck
2026-07-29 20:11 ` Luck, Tony [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=ampeVc1SCnnvqu9y@agluck-desk3 \
    --to=tony.luck@intel.com \
    --cc=Dave.Martin@arm.com \
    --cc=babu.moger@amd.com \
    --cc=david.e.box@intel.com \
    --cc=dfustini@baylibre.com \
    --cc=fenghuay@nvidia.com \
    --cc=hch@infradead.org \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=patches@lists.linux.dev \
    --cc=peternewman@google.com \
    --cc=reinette.chatre@intel.com \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@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