Re: [PATCH v7 11/14] mpam,x86/resctrl: Resolve INTEL_PMT_TELEMETRY symbols at runtime
From: Reinette Chatre
Date: Wed Jun 10 2026 - 11:31:17 EST
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?
...
>>> +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?
Reinette