Re: [PATCH v2 07/24] x86/resctrl: Store the effective num_closid in the schema

From: Reinette Chatre
Date: Wed Mar 31 2021 - 17:39:56 EST


Hi James,

On 3/12/2021 9:58 AM, James Morse wrote:
The resctrl_schema struct holds properties that vary with the style of
configuration that resctrl applies to a resource.

There are already two values for the hardware's num_closid, depending on
whether the architecture presents the L3 or L3CODE/L3DATA resources.

As the way CDP changes the number of control groups that resctrl can create
is part of the user-space interface, it should be managed by the filesystem

s/create is part of/create as part of/ ?

parts of resctrl. This allows the architecture code to only describe the
value the hardware supports.

Add num_closid to resctrl_schema. This is the value seen by the filesystem,
and when the CDP resources are merged, will be different to the value
described by the arch code when CDP is enabled.

These functions operate on the num_closid value that is exposed to
user-space:
rdtgroup_parse_resource()
rdtgroup_schemata_show()
rdt_num_closids_show()
closid_init()

These are changed to use the schema value instead.

schemata_list_create() sets this value, and reaches into the architecture
specific structure to get the value. This will eventually be replaced with
a helper.

Reviewed-by: Jamie Iles <jamie@xxxxxxxxxxxx>
Signed-off-by: James Morse <james.morse@xxxxxxx>


...

diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index c6f749f54765..0ff10468940b 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -165,10 +165,12 @@ struct rdt_resource {
* @list: Member of resctrl's schema list
* @conf_type: Whether this entry is for code/data/both
* @res: The rdt_resource for this entry
+ * @num_closid: Number of CLOSIDs available for this resource

It is not clear what "this resource" is. This description is essentially the same as its copy found in rdt_hw_resource. Could you please improve these descriptions to capture the differences between the two num_closid values?

Thank you

Reinette