Re: [PATCH v5 07/40] x86/resctrl: Add max_bw to struct resctrl_membw

From: Tony Luck
Date: Wed Oct 09 2024 - 14:03:16 EST


On Fri, Oct 04, 2024 at 06:03:14PM +0000, James Morse wrote:
> diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> index 8d1bdfe89692..56c41bfd07e4 100644
> --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> @@ -57,10 +57,10 @@ static bool bw_validate(char *buf, unsigned long *data, struct rdt_resource *r)
> return false;
> }
>
> - if ((bw < r->membw.min_bw || bw > r->default_ctrl) &&
> + if ((bw < r->membw.min_bw || bw > r->membw.max_bw) &&
> !is_mba_sc(r)) {
> rdt_last_cmd_printf("MB value %ld out of range [%d,%d]\n", bw,
> - r->membw.min_bw, r->default_ctrl);
> + r->membw.min_bw, r->membw.max_bw);
> return false;
> }
>

Heads up. There is a patch to this function in the TIP x86/urgent
branch. So will likely go into v6.12-rc3. So this patch will need
to refactor on top of:

https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/urgent&id=2b5648416e47933939dc310c4ea1e29404f35630

-Tony