RE: [PATCH v7 11/14] mpam,x86/resctrl: Resolve INTEL_PMT_TELEMETRY symbols at runtime

From: Luck, Tony

Date: Wed Jun 10 2026 - 13:25:21 EST


> I see many "if (pmt_module)" checks ... intel_aet_pre_mount() even calls it twice. Are they all necessary?
> It creates the impression that the PMT module can be yanked from AET at any time, something which
> intel_aet_unregister_enumeration() seems to allow. I was hoping that there can be some guarantee
> that if PMT is available during pre_mount() it will continue to be available at least until
> unmount() completes.

pmt_module is NULL if CONFIG_INTEL_PMT_TELEMETRY=y ... i.e. built-in to the kernel.

In that case it obviously can't go away, and doesn't need module_get()/module_put().
There's no special case for this. try_module_get() takes a fault on NULL dereference.

When CONFIG_INTEL_PMT_TELEMETRY=m then the get/put should stop it going away
(I tried rmmod while resctrl mounted and it fails to remove as expected).

-Tony