RE: [PATCH v20 00/18] Add support for Sub-NUMA cluster (SNC) systems

From: Luck, Tony
Date: Thu Jun 13 2024 - 17:03:22 EST


> Looking at the series again, I see this approach adds lots of code.
> Look at this structure.
>
>
> @@ -187,10 +196,12 @@ struct rdt_resource {
> bool alloc_capable;
> bool mon_capable;
> int num_rmid;
> - enum resctrl_scope scope;
> + enum resctrl_scope ctrl_scope;
> + enum resctrl_scope mon_scope;
> struct resctrl_cache cache;
> struct resctrl_membw membw;
> - struct list_head domains;
> + struct list_head ctrl_domains;
> + struct list_head mon_domains;
> char *name;
> int data_width;
> u32 default_ctrl;
>
> There are two scope fields.
> There are two domains fields.

I might at some future time split struct rdt_resource into struct
rdt_ctrl_resource and struct rdt_mon_resource. That would get rid of
multiple scope and domain fields. There are also a bunch of fields that
are specific to just ctrl or mon functions.

That would require other churn. E.g. getting rid of the
rdt_resources_all[] array and the macros that scan it to perform
various actions. Replace with two lists, one each for active ctrl/mon
resources. Once James' patches to split into architecture vs. generic
parts are applied this might be useful so that CPU vendors could add
resources that didn't have equivalents for other architectures.

There isn't a pressing need for that today. But splitting the rdt_domain
structure now makes for a good base to build on later (if needed).

-Tony