Re: [PATCH v3 1/3] x86/resctrl: Add resctrl_arch_preconvert_bw()
From: Reinette Chatre
Date: Fri Jun 05 2026 - 14:47:35 EST
Hi Ben,
Since this patch also impacts resctrl fs API in include/linux/resctrl.h the
subject prefix would more accurate as "x86,fs/resctrl: Add ..."
On 5/15/26 7:06 AM, Ben Horgan wrote:
...
> @@ -500,6 +500,25 @@ bool resctrl_arch_mbm_cntr_assign_enabled(struct rdt_resource *r);
> */
> int resctrl_arch_mbm_cntr_assign_set(struct rdt_resource *r, bool enable);
>
> +/**
> + * resctrl_arch_preconvert_bw() - Prepare bandwidth control value for arch use.
> + * @val: Bandwidth control value written to the schemata file by userspace.
> + * @r: Resource whose schema was written.
> + *
> + * Convert the user provided bandwidth control value to an appropriate form for
> + * consumption by the hardware driver for resource @r. Converted value is stored
> + * in rdt_ctrl_domain::staged_config[] for later consumption by
> + * resctrl_arch_update_domains(). Is not called when MBA software controller is
> + * enabled.
> + *
> + * Architectures for which this pre-conversion hook is not useful should supply
> + * an implementation of this function that just returns val unmodified.
nit: "val" -> "@val"
> + *
> + * Return:
> + * The converted value.
> + */
> +u32 resctrl_arch_preconvert_bw(u32 val, const struct rdt_resource *r);
Could you please switch the resource to be the first parameter? When comparing
this to other similar arch helpers in include/linux/resctrl.h it is custom for the resource
to be the first parameter.
> +
> /*
> * Update the ctrl_val and apply this config right now.
> * Must be called on one of the domain's CPUs.
| Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
Reinette