Re: [PATCH v7 18/49] x86/resctrl: Move the is_mbm_*_enabled() helpers to asm/resctrl.h
From: Reinette Chatre
Date: Thu Mar 06 2025 - 23:36:57 EST
Hi James,
On 2/28/25 11:58 AM, James Morse wrote:
> The architecture specific parts of resctrl provide helpers like
> is_mbm_total_enabled() and is_mbm_local_enabled() to hide accesses
> to the rdt_mon_features bitmap.
>
> Exposing a group of helpers between the architecture and filesystem code
> is preferable to a single unsigned-long like rdt_mon_features. Helpers
> can be more readable and have a well defined behaviour, while allowing
> architectures to hide more complex behaviour.
>
> Once the filesystem parts of resctrl are moved, these existing helpers can
> no longer live in internal.h. Move them to include/linux/resctrl.h
> Once these are exposed to the wider kernel, they should have a
> 'resctrl_arch_' prefix, to fit the rest of the arch<->fs interface.
>
> Move and rename the helpers that touch rdt_mon_features directly.
> is_mbm_event() and is_mbm_enabled() are only called from rdtgroup.c,
> so can be moved into that file.
>
> Signed-off-by: James Morse <james.morse@xxxxxxx>
> Tested-by: Carl Worth <carl@xxxxxxxxxxxxxxxxxxxxxx> # arm64
> Tested-by: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx>
> Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---
Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
Reinette