Re: [PATCH] fs/resctrl,x86/resctrl: Factor mba rounding to be per-arch
From: Dave Martin
Date: Thu Oct 02 2025 - 11:40:56 EST
Hi there,
On Wed, Oct 01, 2025 at 08:13:45PM +0800, Chen, Yu C wrote:
> On 9/30/2025 11:55 PM, Dave Martin wrote:
> > Hi,
> >
> > On Tue, Sep 30, 2025 at 12:43:36PM +0800, Chen, Yu C wrote:
[...]
> > > I overlooked this bit width. It should not exceed 511 according to the
> > > RDT spec. Previously, I was just wondering how to calculate the legacy
> > > MB percentage in Tony's example. If we want to keep consistency - if
> > > the user provides a value of 10, what is the denominator: Is it 255,
> > > 511, or something queried from ACPI.
> > >
> > > MB: 0=4;1=75 <--- 10/255
> > > #MB_HW: 0=10;1=191
> > > #MB_MIN: 0=10;1=191
> > > #MB_MAX: 0=64;1=191
> > >
> > > or
> > >
> > > MB: 0=1;1=75 <--- 10/511
> > > #MB_HW: 0=10;1=191
> > > #MB_MIN: 0=10;1=191
> > > #MB_MAX: 0=64;1=191
> > >
> > > thanks,
> > > Chenyu
> >
> > The denomiator (the "scale" parameter in my model, though the name is
> > unimportant) should be whatever quantity of resource is specified in
> > the "unit" parameter.
> >
> > For "percentage" type controls, I'd expect the unit to be 100% ("100pc"
> > in my syntax).
> >
> > So, Tony suggestion looks plausible to me [1] :
> >
> > | Yes. 255 (or whatever "Q" value is provided in the ACPI table)
> > | corresponds to no throttling, so 100% bandwidth.
> >
> > So, if ACPI says Q=387, that's the denominator we advertise.
> >
> > Does that sound right?
> >
>
> Yes, it makes sense, the denominator is the "scale" in your example.
Thanks for confirming that.
> > Question: is this a global parameter, or per-CPU?
> >
>
> It should be a global setting for all the MBA Register Blocks.
That's good -- since resctrl resource controls are not per-CPU,
exposing the exact hardware resolution won't work unless the value
is scaled identically for all CPUs.
Cheers
---Dave