]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/resctrl: Add node-scope to the options for feature scope
authorTony Luck <tony.luck@intel.com>
Fri, 28 Jun 2024 21:56:05 +0000 (14:56 -0700)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 2 Jul 2024 17:49:54 +0000 (19:49 +0200)
Currently supported resctrl features are all domain scoped the same as the
scope of the L2 or L3 caches.

Add RESCTRL_L3_NODE as a new option for features that are scoped at the
same granularity as NUMA nodes. This is needed for Intel's Sub-NUMA
Cluster (SNC) feature where monitoring features are divided between
nodes that share an L3 cache.

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-6-tony.luck@intel.com
arch/x86/kernel/cpu/resctrl/core.c
include/linux/resctrl.h

index b4f2be776408188188b74ab55dab90f320b1c102..b86c525d0620a1b97867caf38856b3ca0afa8c34 100644 (file)
@@ -510,6 +510,8 @@ static int get_domain_id_from_scope(int cpu, enum resctrl_scope scope)
        case RESCTRL_L2_CACHE:
        case RESCTRL_L3_CACHE:
                return get_cpu_cacheinfo_id(cpu, scope);
+       case RESCTRL_L3_NODE:
+               return cpu_to_node(cpu);
        default:
                break;
        }
index aa2c22a8e37b3dc50bab00665b4ffe00a419a7bf..64b6ad1b22a14bdeb658cfeab6e3829e64994594 100644 (file)
@@ -176,6 +176,7 @@ struct resctrl_schema;
 enum resctrl_scope {
        RESCTRL_L2_CACHE = 2,
        RESCTRL_L3_CACHE = 3,
+       RESCTRL_L3_NODE,
 };
 
 /**