Re: [PATCH v4 3/7] fs/resctrl: Add interface to disable a monitor event
From: Luck, Tony
Date: Tue Apr 07 2026 - 14:41:17 EST
On Mon, Apr 06, 2026 at 02:13:19PM -0700, Reinette Chatre wrote:
> Hi Tony,
>
> On 4/6/26 11:35 AM, Luck, Tony wrote:
> > On Fri, Apr 03, 2026 at 05:03:28PM -0700, Reinette Chatre wrote:
>
> ...
>
> >
> >> At this
> >> time these scenarios may just fall into the "architecture must do the
> >> right thing" category since it has best information on how state is
> >> managed for the events as they are enabled/disabled.
> >
> > Are you suggesting to just drop the check for resctrl_mounted (as both
> > a locking issue, and an incomplete solution)?
>
> I am indeed suggesting to "drop the check for resctrl_mounted" but instead
> of "just" doing that I think it worthwhile to add function comments to these
> two arch helpers in include/linux/resctrl.h that describes what needs to be
> considered when calling them. That is, describe "architecture must do the
> right thing" with some documentation about what needs to be considered.
> Such documentation may help us to start putting some boundaries on how
> these helpers can/should be used to help guide any future enhancements to
> make this more robust.
Something like this:
/*
* For events that require per-domain allocation, this routine must be called
* before CPU hot plug state begins allocating domain structures.
* For other events the requirement is that the file system must not be
* mounted when enabling events.
*/
bool resctrl_enable_mon_event(enum resctrl_event_id eventid, bool any_cpu,
unsigned int binary_bits, void *arch_priv)
...
/*
* This routine must not be called for events that require per-domain allcoation.
* For other events the requirement is that the file system must not be
* mounted when disabling events.
*/
void resctrl_disable_mon_event(enum resctrl_event_id eventid)
>
> Reinette