Re: [PATCH v10 02/12] arm,x86,fs/resctrl: Move resctrl_arch_round_mon_val() out of line

From: Reinette Chatre

Date: Wed Nov 25 2026 - 15:07:29 EST


Hi Chenyu,

On 11/5/26 2:08 AM, Chen Yu wrote:
> resctrl_arch_round_mon_val() is an inline function in the x86 and MPAM
> architecture headers. It is only called during resctrl initialization and when
> user space writes "max_threshold_occupancy", neither of which is a hot path that
> benefits from inlining.
>
> Upcoming ERDT support needs resctrl_arch_round_mon_val() to consult
> ERDT-specific state. Keeping it inline would force ERDT prototypes into the x86
> asm header, fragmenting the ERDT code into a header where it does not belong.
>
> Move resctrl_arch_round_mon_val() into monitor.c and declare it in
> include/linux/resctrl.h alongside the other resctrl_arch_*() calls. Move the
> MPAM stub from arm_mpam.h into mpam_resctrl.c accordingly.

The final paragraph narrates what can be seen from the patch self.
How about something like:
In preparation for ERDT support, declare resctrl_arch_round_mon_val() with the
other architecture interfaces called by resctrl so that resctrl no longer forces
architectures to implement it inline in a header. Move the x86 and MPAM
implementations out of their headers.

>
> No functional change.
>
> Suggested-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
> Signed-off-by: Chen Yu <yu.c.chen@xxxxxxxxx>
> Tested-by: Hongyu Ning <hongyu.ning@xxxxxxxxxxxxxxx>
> Acked-by: Ben Horgan <ben.horgan@xxxxxxx>
> ---

With changelog fixed:
| Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette