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

From: Reinette Chatre

Date: Wed Sep 09 2026 - 23:58:14 EST


Hi Tony,

On 8/31/26 10:44 AM, Tony Luck wrote:
> resctrl_mon_capable() indicates whether any monitoring resources
> are enabled on the system. It does this by scanning all resources.
>
> Redundant calls to resctrl_arch_mon_capable() in hot code paths should

resctrl_arch_mon_capable() -> resctrl_mon_capable()

> be eliminated. There are two prime examples:
>
> 1) mbm_handle_overflow()
> This function is called once per second from worker threads running on
> each L3 domain. The call is clearly redundant because worker threads are
> only created if the MBM monitoring feature is enabled.
>
> 2) is_rmid_match()
> This is called for every task on the system so making it less expensive is
> appealing. The call is redundant because the function also checks "r->type
> == RDTMON_GROUP" and this type of group can only be created on systems that
> support monitoring.
>
> Remove the call to resctrl_mon_capable() from both of these
> functions.

(unnecessary line break)

Patch looks good to me. I agree that sashiko's suggestion of an addition looks good.

Reinette