diff options
author | Tony Luck <tony.luck@intel.com> | 2024-06-28 14:56:01 -0700 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2024-07-02 19:49:53 +0200 |
commit | f436cb6913a57bf3e1e66d18bc663e6c20751929 (patch) | |
tree | 5d639e745831cd5af38c3ecf2211910e51f9d5f7 /include/linux | |
parent | f385f024639431bec3e70c33cdbc9563894b3ee5 (diff) | |
download | linux-stable-f436cb6913a57bf3e1e66d18bc663e6c20751929.tar.gz linux-stable-f436cb6913a57bf3e1e66d18bc663e6c20751929.tar.bz2 linux-stable-f436cb6913a57bf3e1e66d18bc663e6c20751929.zip |
x86/resctrl: Prepare for new domain scope
Resctrl resources operate on subsets of CPUs in the system with the
defining attribute of each subset being an instance of a particular
level of cache. E.g. all CPUs sharing an L3 cache would be part of the
same domain.
In preparation for features that are scoped at the NUMA node level,
change the code from explicit references to "cache_level" to a more
generic scope. At this point the only options for this scope are groups
of CPUs that share an L2 cache or L3 cache.
Clean up the error handling when looking up domains. Report invalid ids
before calling rdt_find_domain() in preparation for better messages when
scope can be other than cache scope. This means that rdt_find_domain()
will never return an error. So remove checks for error from the call sites.
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Link: https://lore.kernel.org/r/20240628215619.76401-2-tony.luck@intel.com
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/resctrl.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index a365f67131ec..ed693bfe474d 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -150,13 +150,18 @@ struct resctrl_membw { struct rdt_parse_data; struct resctrl_schema; +enum resctrl_scope { + RESCTRL_L2_CACHE = 2, + RESCTRL_L3_CACHE = 3, +}; + /** * struct rdt_resource - attributes of a resctrl resource * @rid: The index of the resource * @alloc_capable: Is allocation available on this machine * @mon_capable: Is monitor feature available on this machine * @num_rmid: Number of RMIDs available - * @cache_level: Which cache level defines scope of this resource + * @scope: Scope of this resource * @cache: Cache allocation related data * @membw: If the component has bandwidth controls, their properties. * @domains: RCU list of all domains for this resource @@ -174,7 +179,7 @@ struct rdt_resource { bool alloc_capable; bool mon_capable; int num_rmid; - int cache_level; + enum resctrl_scope scope; struct resctrl_cache cache; struct resctrl_membw membw; struct list_head domains; |