Re: [PATCH v7 10/14] platform/x86/intel/pmt: Register enumeration functions with resctrl
From: Reinette Chatre
Date: Mon Jun 22 2026 - 11:46:43 EST
Hi Tony,
On 6/18/26 2:15 PM, Luck, Tony wrote:
> On Mon, Jun 08, 2026 at 04:22:27PM -0700, Reinette Chatre wrote:
>> Hi Tony,
>>
>> On 6/1/26 12:56 PM, Tony Luck wrote:
>>> INTEL_PMT_TELEMETRY is a loadable module, but resctrl is built-in and cannot
>>> call PMT functions directly. Register the telemetry enumeration function
>>> pointers at pmt_telemetry module init, and unregister them at module exit.
>>
>> To ensure intel_pmt_get_regions_by_feature() has access to complete data, could
>> it be more accurate to register at the end of PMT's .probe() and similarly
>> unregister during .remove()?
>
> I agreed with this. But on further reflection I'm going to dissent.
>
> There are multiple devices (at least one per socket). So .probe() is
> called for each. Registering with resctrl at the end of .probe() sets
Thanks for highlighting this.
> up for a race with a mount of the resctrl file system:
>
> modprobe mount
> .init()
> auxiliary_driver_register()
> .probe() for socket 0 device rdt_get_tree()
> intel_aet_register_enumeration() resctrl_arch_pre_mount()
> mutex_lock(aet_register_lock) intel_aet_pre_mount()
> get_feature = get; mutex_lock(aet_register_lock)
> ... ... blocks ...
> mutex_unlock(aet_register_lock)
> ... runs ...
> .probe() for socket 1 device Does enumeration with socket 0 complete
> but races with socket 1 .probe()
Could you please elaborate the details being the "race with socket 1"? Wouldn't
moving registration to init() experience the same? That is, if registered during init() then
at the time of resctrl mount socket 0's probe could be complete but not socket 1's? The
move to .init() has additional scenario where resctrl mounts when neither socket's
probe has completed.
Are you referring to how user needs to remount resctrl to obtain all of AET that
the doc patch refers to or is the race more serious?
> I may keep the unregister call in the .remove() because as soon as the first
> device goes away, resctrl can't usefully run. So it seems a good idea to
> handle that right away.
The "resctrl can't usefully run" is not clear to me since resctrl mount seems to be
ok to let mount succeed without all devices probed (per above). So it is ok to mount
resctrl with partial telemetry enumeration but once all is enumerated this will not
be supported?
>
> I will provide details on the reason for the asymmetric .init() vs. .remove()
> in the commit comment (and in code).
>
> Ok?
I seem to be missing a few details to understand this solution.
Reinette