Re: [PATCH 10/24] x86/resctrl: Move the schema names into struct resctrl_schema

From: James Morse
Date: Fri Mar 12 2021 - 12:39:00 EST


Hi Reinette,

On 17/11/2020 23:11, Reinette Chatre wrote:
> On 10/30/2020 9:11 AM, James Morse wrote:
>> Move the names used for the schemata file out of the resource and
>> into struct resctrl_schema. This allows one resource to have two
>> different names, based on the other schema properties.
>>
>> This patch copies the names, eventually resctrl will generate them.
>
> Please remove "This patch".
>
>>
>> Remove the arch code's max_name_width, this is now resctrl's
>> problem.

>> diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> index a65ff53394ed..28d69c78c29e 100644
>> --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>
> ...
>
>> @@ -391,7 +389,7 @@ static void show_doms(struct seq_file *s, struct resctrl_schema
>> *schema, int clo
>>       bool sep = false;
>>       u32 ctrl_val;
>>   -    seq_printf(s, "%*s:", max_name_width, r->name);
>> +    seq_printf(s, "%*s:", RESCTRL_NAME_LEN, schema->name);
>
> From what I understand this changes what some users will see. In the original code the
> "max_name_width" is computed based on the maximum length of resources supported. Systems
> that only support MBA would thus show a schemata of:
>
> MB:0=100;1=100
>
> I expect the above change would change the output to:
>     MB:0=100;1=100

Aha! Despite the comment - I've totally miss-understood what this code is doing.


Thanks!

James