Re: [PATCH v11 11/23] fs/resctrl: Add interface to disable a monitor event
From: Reinette Chatre
Date: Wed Sep 09 2026 - 23:58:48 EST
Hi Tony,
On 8/31/26 10:44 AM, Tony Luck wrote:
> resctrl currently assumes all monitor events are enabled before any domain
> is created, because per-domain state is allocated by the architecture's CPU
> hotplug callbacks. There is no way to disable an event once registered.
>
> AET events are enumerated by the INTEL_PMT_TELEMETRY driver. To allow that
> driver to be a loadable module, resctrl must tolerate AET events appearing
> and disappearing, which requires the ability to disable an event when the
> driver is unloaded.
>
> Add resctrl_disable_mon_event(). The architecture owns domain lifetime
> and knows mount state, so it is responsible for calling this only while
> resctrl is unmounted and for cleaning up any per-domain state. Document
> those requirements in the kerneldoc since they are not enforced in code.
>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---
> v11:
> Add Reinette RB tag.
This is missing.
...
> +/**
> + * resctrl_disable_mon_event() - Disable monitoring event
> + * @eventid: ID of the event
> + *
> + * The file system must not be mounted when disabling an event.
There are a bit more sharp corners with disabling of events since events
may be used while filesystem is unmounted. How about adding something like:
"Never disable an event that may be accessed while the file system is unmounted."
Reinette