Re: [RFC] mpam,x86,fs/resctrl: Generic schema description Proof of Concept
From: Reinette Chatre
Date: Thu Jun 04 2026 - 17:42:44 EST
Hi Tony,
On 6/3/26 11:46 AM, Luck, Tony wrote:
> Reinette,
>
> Tiny bug in "mpam,x86,fs/resctrl: Transition resource control to a list"
>
>> /*
>> * Return length needed to display longest control suffix.
>> * Add 1 for the "_" character when control name exists.
>> */
>> size_t resctrl_resource_ctrl_max_len(struct rdt_resource *r)
>> {
>> struct resctrl_ctrl *ctrl;
>> size_t total = 0;
>> size_t len;
>>
>> for_each_resource_ctrl(ctrl,r) {
>> len = strlen(resctrl_ctrl_name_str(ctrl->name));
>> if (len)
>> total += 1 + len;
>
> Should be:
>
> total = max(total, 1 + len);
Thank you very much. I squashed this locally.
>
>> }
>>
>> return total;
>> }
>
> Your sample code just converts "MB" over to using a list of controls.
> Would it also work for code & data priority? E.g. by having controls
> for "_CODE" and "_DATA" that are on the list when CDP is enabled, and
> just a no name control for the default?
This PoC also converts existing cache allocation to use a (one entry) list
of controls. The current idea is that whether CDP is enabled or not there is
just one list of controls associated with the resource but when CDP is enabled
every domain associated with every control can accommodate both a "CODE" and
"DATA" control value.
For cache controls this PoC indeed still has many assumptions about there
being only one cache control. Even with the single control there are many
CDP special cases so there may be some unexplored corners when adding multiple
cache controls.
Reinette