Re: [RFC] mpam,x86,fs/resctrl: Generic schema description Proof of Concept

From: Reinette Chatre

Date: Tue Jun 02 2026 - 23:46:13 EST


Hi Chenyu,

On 6/2/26 4:32 PM, Chen, Yu C wrote:
> Hi Reinette,
> On 5/30/2026 2:06 AM, Reinette Chatre wrote:
>
> [ ... ]
>
>> /**
>>   * struct resctrl_ctrl - A resource control
>>   * @entry:    List entry of rdt_resource::controls
>>   * @scope:    Scope of the resource that this control allocates
>>   * @domains:    RCU list of all control domains
>>   * @type:    The control type that determines the properties of the control,
>>   *        format string for displaying control values to user space, and
>>   *        parser of control values provided by user space.
>>   * @name:    Name of the control. Appended to final resource name
>>   *        (rdt_resource_final::name) to create final schema entry.
>>   *        Specifically, "rdt_resource_final::name"_"resctrl_ctrl::name".
>>   *        For example, with resource name "MB" and control name "MAX" the
>>   *        schema entry will be "MB_MAX".
>>   * @cache:    Cache allocation control properties.
>>   * @membw:    Bandwidth control properties.
>>   */
>> struct resctrl_ctrl {
>>     struct list_head    entry;
>>     enum resctrl_scope    scope;
>>     struct list_head    domains;
>>     enum resctrl_ctrl_type    type;
>>     enum resctrl_ctrl_name    name;
>>     union {
>>         struct resctrl_cache    cache;
>>         struct resctrl_membw    membw;
>>     };
>> };
>>
>
> Thanks for re-spinning this patch set.
> Looking at commit (fs/resctrl: Introduce additional schema properties),
> the newly added properties appear to be implemented for the
> MBA resctrl_membw controller.

Please do note that the "struct resctrl_membw" naming is temporary. I only kept
current naming to help folks find where existing known structures land in this new
design but the "struct resctrl_membw" name is not appropriate moving forward.

When user space interacts with the new controls the intention is that each control
has a "type" that the user can find in the new "type" file and depending on that value
the user will know what other files/properties can be expected.

In this PoC there are two types: "scalar" and "bitmap" and each is associated with
a struct that contains the properties associated with that type.

Considering this, these structures could, for example, be renamed as (very long):
struct resctrl_membw -> struct resctrl_ctrl_scalar
struct resctrl_cache -> struct resctrl_ctrl_bitmap

> Would it make sense for these properties to be generic across all resctrl
> controllers, CAT included? Should they consequently be relocated into
> struct resctrl_ctrl if that approach is appropriate?

If there are properties that are common across all controls of all types
then they should be moved to struct resctrl_ctrl. Current examples are "type"
and "scope" that user space can expect from every control. It is not obvious to
me at this time what other properties we can designate as common in this way.

For bitmaps there is already the properties that are available in the top-level
directory. These can just be replicated as properties into the resource_schemata,
but perhaps using new names as suggested by Dave in
https://lore.kernel.org/lkml/aQOUAeVP9oc7RIn%2F@xxxxxxxxxxxxxxx/

Reinette