Re: [PATCH v7 11/14] mpam,x86/resctrl: Resolve INTEL_PMT_TELEMETRY symbols at runtime
From: Luck, Tony
Date: Wed Jun 10 2026 - 12:13:15 EST
On Wed, Jun 10, 2026 at 08:27:15AM -0700, Reinette Chatre wrote:
> Hi Tony,
>
> On 6/9/26 5:08 PM, Luck, Tony wrote:
> > On Mon, Jun 08, 2026 at 04:25:51PM -0700, Reinette Chatre wrote:
>
>
> >>> instead of direct link-time references to PMT symbols.
> >>>
> >>> Prepare for the file system to call resctrl_arch_pre_mount() on every mount
> >>> by moving AET enumeration into resctrl_arch_pre_mount() and cleanup into
> >>> resctrl_arch_unmount(). This allows the PMT module to be unloaded whenever
> >>> the filesystem is not mounted.
> >>>
> >>> Remove intel_aet_exit because all cleanup now happens in the unmount path.
> >>>
> >>> Note that the Linux file system code does not serialize calls to
> >>> fs_context_operations::get_tree(), so there may be arbitrarily many
> >>> parallel calls if users invoke mount(2) multiple times.
> >>>
> >>> Add locking and state (resctrl_arch_mount_entries) to avoid repeated
> >>> enumeration on nested mount requests from file system code (which will be
> >>> failed with -EBUSY status).
> >>>
> >>> event_group::num_rmid may be reset (reduced) during enumeration. This is
> >>> not worth resetting on unmount because the same reduction would occur on
> >>> each subsequent mount.
> >>
> >> Even more important to ensure that PMT is done with its enumeration when
> >> AET enumeration starts?
> >
> > Would be nice, but I still don't know a way to make that happen.
>
> Could it help to have AET depends on PMT probe being complete?
I think I looked at this before, and it didn't help. IIRC the PMT probe
kicks off enumeration of the auxiliary bus, but doesn't wait. I'll check
again with David to see if there is anything that can be done here.
> ...
>
> >>> +void intel_aet_unmount(void)
> >>> {
> >>> struct event_group **peg;
> >>>
> >>> + guard(mutex)(&aet_register_lock);
> >>
> >> Could this get a short-circuit to make behavior on AMD obvious?
> >
> > Like this?
> >
> > if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
> > return;
> >
> > Same in intel_aet_pre_mount() for symmetry??
>
> I do not see that this requires to be architecture specific. This capability
> introduces AET register()/unregister() and pre_mount()/unmount().
> pre_mount() already does no-op if (essentially) nothing is registered. Could
> unmount() similarly be a no-op if (essentially) nothing is registered?
Ah, I see. Maybe I just need a better name for my "have_pmt_hold" flag
so it can be used as the fast exit indicator in intel_aet_unmount().
Perhaps "pmt_in_use"?
Then:
if (!pmt_in_use)
return;
>
> Reinette
-Tony