Re: [PATCH v5 08/40] x86/resctrl: Generate default_ctrl instead of sharing it
From: James Morse
Date: Fri Feb 07 2025 - 10:44:14 EST
Hi Reinette,
On 23/10/2024 22:15, Reinette Chatre wrote:
> On 10/4/24 11:03 AM, James Morse wrote:
>> The struct rdt_resource default_ctrl is used by both the architecture
>> code for resetting the hardware controls, and by the filesystem parts
>> of resctrl to report to user-space.
>
> This is not accurate. The hardware controls may be different from
> what is reported to user-space, for example when MBA software controller
> is active.
That is what I'm trying to say with both paragraphs. This is an odd one when trying
to reduce the duplication in defining properties - its used as the default, except when it
isn't.
>> This means the value has to be shared, but might not match the
>> properties of the control. e.g. a percentage greater than 100.
>
> Are you referring to software controller here? When would this not
> match properties of control? That this value may not match properties
> of control contradicts first paragraph that this is used to reset the
> control ...
I am - the hardware takes a percentage. Sometimes resctrl blindly reports that to
user-space as the default/maximum, but if mba_sc is in use, user-space is told something
different - but the hardware still takes a percentage. This value is used as the default,
except when it isn't. This is messy to generalise.
I'll replace the commit message with:
-----------%<-----------
The struct rdt_resource default_ctrl is used by both the architecture code for
resetting the hardware controls, and sometimes by the filesystem code as the
default value for the schema, unless the bandwidth software controller is in use.
Having the default exposed by the architecture code causes unnecessary duplication
for each architecture as the default value must be specified, but can be derived
from other schema properties. Now that the maximum bandwidth is explicitly
described, resctrl can derive the default value from the schema format and the
other resource properties.
-----------%<-----------
Thanks,
James