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
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