Re: [PATCH v9 5/9] x86/resctrl: Relax checks for mba_MBps mount option

Reinette Chatre
2024-11-20T03:54:16Z

Hi Tony,

On 11/13/24 4:17 PM, Tony Luck wrote:
> This option may be used with any memory bandwidth monitoring event.

Needs a changelog.

>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> index a8022bddf9f7..3a89516e6f56 100644
> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> @@ -2334,7 +2334,7 @@ static bool supports_mba_mbps(void)
> struct rdt_resource *rmbm = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
> struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl;
>
> - return (is_mbm_local_enabled() &&
> + return (is_mbm_enabled() &&
> r->alloc_capable && is_mba_linear() &&
> r->ctrl_scope == rmbm->mon_scope);
> }

I *thought* I had a handle on things with the understanding that rdtgroup.mba_mbps_event
is only valid when mba_sc is enabled. This understanding falls apart with this change since
at this point in series if a system only supports total MBM then mba_sc may be true
but rdtgroup.mba_mbps_event will be zero.

The expectation is that patches build on each other to create a solution but this series
does not respect this making it difficult to reason about this work. I think this series
will be easier to understand if "x86/resctrl: Make mba_sc use total bandwidth if local
is not supported" is moved before this change.

> @@ -2759,7 +2759,7 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param)
> ctx->enable_cdpl2 = true;
> return 0;
> case Opt_mba_mbps:
> - msg = "mba_MBps requires local MBM and linear scale MBA at L3 scope";
> + msg = "mba_MBps requires MBM and linear scale MBA at L3 scope";
> if (!supports_mba_mbps())
> return invalfc(fc, msg);
> ctx->enable_mba_mbps = true;

Reinette