Re: [PATCH v6 06/42] x86/resctrl: Remove data_width and the tabular format

From: Reinette Chatre
Date: Wed Feb 19 2025 - 17:36:06 EST


Hi James,

On 2/7/25 10:17 AM, James Morse wrote:
> The resctrl architecture code provides a data_width for the controls of
> each resource. This is used to zero pad all control values in the schemata
> file so they appear in columns. The same is done with the resource names
> to complete the visual effect. e.g.
> | SMBA:0=2048
> | L3:0=00ff
>
> AMD platforms discover their maximum bandwidth for the MB resource from
> firmware, but hard-code the data_width to 4. If the maximum bandwidth
> requires more digits - the tabular format is silently broken.
> This is also broken when the mba_MBps mount option is used as the
> field width isn't updated. If new schema are added resctrl will need
> to be able to determine the maximum width. The benefit of this
> pretty-printing is questionable.
>
> Instead of handling runtime discovery of the data_width for AMD platforms,
> remove the feature. These fields are always zero padded so should be
> harmless to remove if the whole field has been treated as a number.
> In the above example, this would now look like this:
> | SMBA:0=2048
> | L3:0=ff
>
> Signed-off-by: James Morse <james.morse@xxxxxxx>
> Tested-by: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx>
> Reviewed-by: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx>
> Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---

Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette