Re: [PATCH v5 22/40] x86/resctrl: Move mbm_cfg_mask to struct rdt_resource

From: Reinette Chatre
Date: Wed Oct 23 2024 - 18:42:21 EST


Hi James,

On 10/4/24 11:03 AM, James Morse wrote:
> The mbm_cfg_mask field lists the bits that user-space can set when
> configuring an event. This value is output via the last_cmd_status
> file.
>
> Once the filesystem parts of resctrl are moved to live in /fs/, the
> struct rdt_hw_resource is inaccessible to the filesystem code. Because
> this value is output to user-space, it has to be accessible to the
> filesystem code.
>
> Move it to struct rdt_resource.
>

fyi:
https://lore.kernel.org/all/fc424d4bee8ac9887703fecbaad26dba3c633f72.1728495588.git.babu.moger@xxxxxxx/

> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h
> index 6b076216911c..92a94939cf93 100644
> --- a/arch/x86/kernel/cpu/resctrl/internal.h
> +++ b/arch/x86/kernel/cpu/resctrl/internal.h
> @@ -415,8 +415,6 @@ struct msr_param {
> * @msr_update: Function pointer to update QOS MSRs
> * @mon_scale: cqm counter * mon_scale = occupancy in bytes
> * @mbm_width: Monitor width, to detect and correct for overflow.
> - * @mbm_cfg_mask: Bandwidth sources that can be tracked when Bandwidth
> - * Monitoring Event Configuration (BMEC) is supported.
> * @cdp_enabled: CDP state of this resource
> *
> * Members of this structure are either private to the architecture
> @@ -430,7 +428,6 @@ struct rdt_hw_resource {
> void (*msr_update)(struct msr_param *m);
> unsigned int mon_scale;
> unsigned int mbm_width;
> - unsigned int mbm_cfg_mask;
> bool cdp_enabled;
> };
>

...

> diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
> index 0072c2e5947f..84588ab1994d 100644
> --- a/include/linux/resctrl.h
> +++ b/include/linux/resctrl.h
> @@ -218,6 +218,8 @@ enum resctrl_schema_fmt {
> * @name: Name to use in "schemata" file.
> * @schema_fmt: Which format string and parser is used for this schema.
> * @evt_list: List of monitoring events
> + * @mbm_cfg_mask: Bandwidth sources that can be tracked when Bandwidth
> + * Monitoring Event Configuration (BMEC) is supported.

Making this arch specific feature something all arch can support is probably the
right time to remove the AMD marketing name. Maybe just:

Bandwidth sources that can be tracked when memory bandwidth
monitoring events can be configured.

Please feel free to improve.

Reinette