x86/cache updates for 4.16
Subsystems (2)
Linus,
please pull the latest x86-cache-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-cache-for-linus
A set of patches which add support for L2 cache partitioning to the Intel RDT facility.
Thanks,
tglx
------------------>
Fenghua Yu (6):
x86/intel_rdt: Update documentation
x86/intel_rdt: Add L2CDP support in documentation
x86/intel_rdt: Enumerate L2 Code and Data Prioritization (CDP) feature x86/intel_rdt: Add two new resources for L2 Code and Data Prioritization (CDP) x86/intel_rdt: Enable L2 CDP in MSR IA32_L2_QOS_CFG x86/intel_rdt: Add command line parameter to control L2_CDP
Documentation/admin-guide/kernel-parameters.txt | 3 +- Documentation/x86/intel_rdt_ui.txt | 13 ++- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/intel_rdt.c | 68 ++++++++++++-- arch/x86/kernel/cpu/intel_rdt.h | 5 + arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 117 ++++++++++++++++++------ arch/x86/kernel/cpu/scattered.c | 1 + 7 files changed, 169 insertions(+), 39 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +2 -1
@@ -3682,7 +3682,8 @@ rdt= [HW,X86,RDT] Turn on/off individual RDT features. List is: - cmt, mbmtotal, mbmlocal, l3cat, l3cdp, l2cat, mba. + cmt, mbmtotal, mbmlocal, l3cat, l3cdp, l2cat, l2cdp, + mba. E.g. to turn on cmt and turn off mba use: rdt=cmt,!mba
Documentation/x86/intel_rdt_ui.txt +11 -2
@@ -7,15 +7,24 @@ Tony Luck <[email protected]> Vikas Shivappa <[email protected]> This feature is enabled by the CONFIG_INTEL_RDT Kconfig and the -X86 /proc/cpuinfo flag bits "rdt", "cqm", "cat_l3" and "cdp_l3". +X86 /proc/cpuinfo flag bits: +RDT (Resource Director Technology) Allocation - "rdt_a" +CAT (Cache Allocation Technology) - "cat_l3", "cat_l2" +CDP (Code and Data Prioritization ) - "cdp_l3", "cdp_l2" +CQM (Cache QoS Monitoring) - "cqm_llc", "cqm_occup_llc" +MBM (Memory Bandwidth Monitoring) - "cqm_mbm_total", "cqm_mbm_local" +MBA (Memory Bandwidth Allocation) - "mba" To use the feature mount the file system: - # mount -t resctrl resctrl [-o cdp] /sys/fs/resctrl + # mount -t resctrl resctrl [-o cdp[,cdpl2]] /sys/fs/resctrl mount options are: "cdp": Enable code/data prioritization in L3 cache allocations. +"cdpl2": Enable code/data prioritization in L2 cache allocations. + +L2 and L3 CDP are controlled seperately. RDT features are orthogonal. A particular system may support only monitoring, only control, or both monitoring and control.
arch/x86/include/asm/cpufeatures.h +1 -0
@@ -206,6 +206,7 @@#define X86_FEATURE_RETPOLINE ( 7*32+12)/* Generic Retpoline mitigation for Spectre variant 2 */ #define X86_FEATURE_RETPOLINE_AMD ( 7*32+13)/* AMD Retpoline mitigation for Spectre variant 2 */ #define X86_FEATURE_INTEL_PPIN ( 7*32+14)/* Intel Processor Inventory Number */ +#define X86_FEATURE_CDP_L2 ( 7*32+15)/* Code and Data Prioritization L2 */ #define X86_FEATURE_AVX512_4VNNIW ( 7*32+16)/* AVX-512 Neural Network Instructions */ #define X86_FEATURE_AVX512_4FMAPS ( 7*32+17)/* AVX-512 Multiply Accumulation Single precision */
arch/x86/kernel/cpu/intel_rdt.c +58 -10
112 lines not on this page · raw message
arch/x86/kernel/cpu/intel_rdt.h +5 -0
@@ -7,12 +7,15 @@#include <linux/jump_label.h> #define IA32_L3_QOS_CFG 0xc81 +#define IA32_L2_QOS_CFG 0xc82#define IA32_L3_CBM_BASE 0xc90#define IA32_L2_CBM_BASE 0xd10#define IA32_MBA_THRTL_BASE 0xd50#define L3_QOS_CDP_ENABLE 0x01ULL +#define L2_QOS_CDP_ENABLE 0x01ULL +/* * Event IDs are used to program IA32_QM_EVTSEL before reading event * counter from IA32_QM_CTR
@@ -357,6 +360,8 @@ enum {RDT_RESOURCE_L3DATA ,RDT_RESOURCE_L3CODE ,RDT_RESOURCE_L2 , +RDT_RESOURCE_L2DATA , +RDT_RESOURCE_L2CODE , RDT_RESOURCE_MBA,/* Must be the last */
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +91 -26
187 lines not on this page · raw message
arch/x86/kernel/cpu/scattered.c +1 -0
@@ -26,6 +26,7 @@ static const struct cpuid_bit cpuid_bits[] = { { X86_FEATURE_CAT_L3, CPUID_EBX, 1, 0x00000010, 0 }, { X86_FEATURE_CAT_L2, CPUID_EBX, 2, 0x00000010, 0 }, { X86_FEATURE_CDP_L3, CPUID_ECX, 2, 0x00000010, 1 }, + { X86_FEATURE_CDP_L2, CPUID_ECX, 2, 0x00000010, 2 }, { X86_FEATURE_MBA, CPUID_EBX, 3, 0x00000010, 0 }, { X86_FEATURE_HW_PSTATE, CPUID_EDX, 7, 0x80000007, 0 }, { X86_FEATURE_CPB, CPUID_EDX, 9, 0x80000007, 0 },