Re: [PATCH v12 18/25] x86/resctrl: Use registered function pointers for AET enumeration

From: Reinette Chatre

Date: Thu Sep 24 2026 - 16:53:18 EST


Hi Tony,

On 9/16/26 4:13 PM, Tony Luck wrote:
> The INTEL_PMT_TELEMETRY driver registers enumeration functions with
> resctrl Application Energy Telemetry (AET) code.
>
> Use the function pointers instead of direct function calls in
> preparation for the telemetry driver to be a loadable module.

This creates expectation that there are no direct function calls
remaining after this patch, but there are. This is part of the
asymmetric concern raised in previous two versions of this patch.

>
> In preparation for enumeration on each mount of the resctrl file system
> place a hold on the pmt_telemetry module while enumerating AET events during
> pre-mount processing. Release the hold if no events were enabled. This hold
> will be released when the per-mount code is added.

You added that this hold will be released in later code. Why? Could
you please add why it is safe to take a hold without releasing it? Why
does this have to be done asymmetrically?

This patch is difficult to reason about since it claims to protect calls to
the module yet it does not remove all the direct calls that continue to be
made without any protection. Even the calls it does claim to protect takes
a hold without releasing it without any indication why it is safe to do so.

At this point this looks like a patch that breaks the driver.

>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
Reinette