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

From: Reinette Chatre
Date: Tue Nov 17 2020 - 17:04:55 EST


Hi James,

On 10/30/2020 9:11 AM, James Morse wrote:
resctrl_schema holds properties that vary with the style of configuration
that resctrl applies to a resource.

Once the arch code has a single resource per cache that can be configured,
resctrl will need to keep track of the num_closid itself.

Add num_closid to resctrl_schema. Change callers like
rdtgroup_schemata_show() to walk the schema instead.

This is a significant patch in that it introduces a second num_closid available for code to use. Even so, the commit message is treating it quite nonchalantly ... essentially stating that "here is a new closid and change some code to use it".

Could you please elaborate how the callers needing to "walk the schema instead" were chosen?

This seems almost a revert of the earlier patch that introduced the helper and I wonder if it may not make this easier to understand if these areas do not receive the temporary change to use that helper.


Signed-off-by: James Morse <james.morse@xxxxxxx>
---
arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 13 ++++++++-----
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 11 +++++------
include/linux/resctrl.h | 2 ++
3 files changed, 15 insertions(+), 11 deletions(-)


...

diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index de6cbc725753..b32152968bca 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -166,10 +166,12 @@ struct rdt_resource {
/**
* @list: Member of resctrl's schema list
* @res: The rdt_resource for this entry
+ * @num_closid Number of CLOSIDs available for this resource

Missing a ":"?

*/
struct resctrl_schema {
struct list_head list;
struct rdt_resource *res;
+ u32 num_closid;
};
/* The number of closid supported by this resource regardless of CDP */


Reinette