Re: [PATCH v14 09/24] fs/resctrl: Remove redundant calls to resctrl_mon_capable()

From: Chen Yu

Date: Tue Oct 20 2026 - 10:09:03 EST


Hi Tony,

On Mon, Oct 19, 2026 at 01:50:16PM -0700, Tony Luck wrote:
> resctrl_mon_capable() reports whether the system supports monitoring by
> scanning all resources. On x86 it used to read a single architecture-provided
> flag. Calls on paths that run repeatedly now pay for the scan.
>
> Two such callers already know that monitoring is supported:
>
> 1) mbm_handle_overflow()
> The MBM overflow handler runs once per second on each L3 monitoring
> domain. It is only set up when MBM events are enabled, which requires
> L3 monitoring support.
>

There is also a resctrl_mon_capable() check in mbm_setup_overflow_handler(),
do we need to remove it too? But it is only called once in mbm_setup_overflow_handler(),
leave it as it is should be OK.

> 2) is_rmid_match()
> Called for every task in the system when walking the task list to read
> a tasks file, remove a group, or unmount. It only matches MON groups,
> which can only be created on a system that supports monitoring.
>
> Remove the call to resctrl_mon_capable() from both functions.
>
> No functional change intended.
>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
>

Reviewed-by: Chen Yu <yu.c.chen@xxxxxxxxx>

thanks,
Chenyu