Re: [PATCH v2] x86,fs/resctrl: Factor MBA parse-time conversion to be per-arch

Dave Martin
2025-11-20T15:30:47Z

Hi Ben,

On Mon, Nov 10, 2025 at 11:06:32AM +0000, Ben Horgan wrote:
> Hi Dave,
>
> On 10/31/25 15:41, Dave Martin wrote:
> > The control value parser for the MB resource currently coerces the
> > memory bandwidth percentage value from userspace to be an exact
> > multiple of the rdt_resource::resctrl_membw::bw_gran parameter.
> >
> > On MPAM systems, this results in somewhat worse-than-worst-case
> > rounding, since the bandwidth granularity advertised to resctrl by the
> > MPAM driver is in general only an approximation to the actual hardware
> > granularity on these systems, and the hardware bandwidth allocation
> > control value is not natively a percentage -- necessitating a further
> > conversion in the resctrl_arch_update_domains() path, regardless of the
> > conversion done at parse time.
> >
> > Allow the arch to provide its own parse-time conversion that is
> > appropriate for the hardware, and move the existing conversion to x86.
> > This will avoid accumulated error from rounding the value twice on MPAM
> > systems.
> >
> > Clarify the documentation, but avoid overly exact promises.
> >
> > Clamping to bw_min and bw_max still feels generic: leave it in the core
> > code, for now.
> >
> > No functional change.
> >
> > Signed-off-by: Dave Martin <Dave.Martin@arm.com>
> >
> Seems sensible and helpful for MPAM.
>
> Reviewed-by: Ben Horgan <ben.horgan@arm.com>

Thanks for taking a look.

Cheers
---Dave