Re: [PATCH v7 07/49] x86/resctrl: Add max_bw to struct resctrl_membw

Fenghua Yu
2025-03-06T21:02:48Z

On 2/28/25 11:58, James Morse wrote:
> __rdt_get_mem_config_amd() and __get_mem_config_intel() both use
> the default_ctrl property as a maximum value. This is because the
> MBA schema works differently between these platforms. Doing this
> complicates determining whether the default_ctrl property belongs
> to the arch code, or can be derived from the schema format.
>
> Deriving the maximum or default value from the schema format would
> avoid the architecture code having to tell resctrl such obvious
> things as the maximum percentage is 100, and the maximum bitmap
> is all ones.
>
> Maximum bandwidth is always going to vary per platform. Add
> max_bw as a special case. This is currently used for the maximum
> MBA percentage on Intel platforms, but can be removed from the
> architecture code if 'percentage' becomes a schema format resctrl
> supports directly.
>
> This value isn't needed for other schema formats.
>
> This will allow the default_ctrl to be generated from the schema
> properties when it is needed.
>
> Signed-off-by: James Morse <james.morse@arm.com>
> Tested-by: Carl Worth <carl@os.amperecomputing.com> # arm64
> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
> Reviewed-by: Tony Luck <tony.luck@intel.com>
> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>

Reviewed-by: Fenghua Yu <fenghuay@nvidia.com>

Thanks.

-Fenghua