Add new AMD feature X86_FEATURE_SMBA. With this feature, the QOS enforcement policies can be applied to external slow memory connected to the host. QOS enforcement is accomplished by assigning a Class Of Service (COS) to a processor and specifying allocations or limits for that COS for each resource to be allocated.
Kernel changes are already committed. Here are the commit ids.
5b6fac3fa44baf x86/resctrl: Detect and configure Slow Memory Bandwidth Allocation
a76f65c89f928 x86/resctrl: Include new features in command line options
78335aac6156 x86/cpufeatures: Add Bandwidth Monitoring Event Configuration feature flag
a5b699665580 x86/resctrl: Add a new resource type RDT_RESOURCE_SMBA
f334f723a63cfc x86/cpufeatures: Add Slow Memory Bandwidth Allocation feature flag
Description
This feature is identified by the CPUID Function 8000_0020_EBX_x0.
Bits Field Name Description
2 L3SBE L3 external slow memory bandwidth enforcement
CXL.memory is the only supported "slow" memory device. With the support of SMBA feature, the hardware enables bandwidth allocation on the slow memory devices. If there are multiple slow memory devices in the system, then the throttling logic groups all the slow sources together and applies the limit on them as a whole.
The presence of the SMBA feature(with CXL.memory) is independent of whether a slow memory device is present in the system. If there is no slow memory in the system, then setting an SMBA limit will have no impact on the performance of the system.
The presence of CXL memory can be identified by numactl command.
CPU list for CXL memory will be empty. The cpu-cxl node distance is
greater than cpu-to-cpu distances. Node 1 has the CXL memory in this
case. CXL memory can also be identified using ACPI SRAT table and
memory maps.
With this feature, the QOS enforcement policies can be applied to the external slow memory connected to the host. QOS enforcement is accomplished by assigning a Class Of Service (COS) to a processor and specifying allocations or limits for that COS for each resource to be allocated.
How Has This Been Tested?
Tested on AMD machine and sanity tested on Intel machine to verify for regression
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[ X] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist:
[ X] My code follows the code style of this project.
[ X] My change requires a change to the documentation.
[ X] I have updated the documentation accordingly.
Add new AMD feature X86_FEATURE_SMBA. With this feature, the QOS enforcement policies can be applied to external slow memory connected to the host. QOS enforcement is accomplished by assigning a Class Of Service (COS) to a processor and specifying allocations or limits for that COS for each resource to be allocated.
Kernel changes are already committed. Here are the commit ids. 5b6fac3fa44baf x86/resctrl: Detect and configure Slow Memory Bandwidth Allocation a76f65c89f928 x86/resctrl: Include new features in command line options 78335aac6156 x86/cpufeatures: Add Bandwidth Monitoring Event Configuration feature flag a5b699665580 x86/resctrl: Add a new resource type RDT_RESOURCE_SMBA f334f723a63cfc x86/cpufeatures: Add Slow Memory Bandwidth Allocation feature flag
Description
This feature is identified by the CPUID Function 8000_0020_EBX_x0.
CPUID Fn8000_0020_EBX_x0 AMD Bandwidth Enforcement Feature Identifiers (ECX=0)
Bits Field Name Description 2 L3SBE L3 external slow memory bandwidth enforcement
CXL.memory is the only supported "slow" memory device. With the support of SMBA feature, the hardware enables bandwidth allocation on the slow memory devices. If there are multiple slow memory devices in the system, then the throttling logic groups all the slow sources together and applies the limit on them as a whole.
The presence of the SMBA feature(with CXL.memory) is independent of whether a slow memory device is present in the system. If there is no slow memory in the system, then setting an SMBA limit will have no impact on the performance of the system.
The presence of CXL memory can be identified by numactl command.
$numactl -H available: 2 nodes (0-1) node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 node 0 size: 63678 MB node 0 free: 59542 MB node 1 cpus: node 1 size: 16122 MB node 1 free: 15627 MB node distances: node 0 1 0: 10 50 1: 50 10
CPU list for CXL memory will be empty. The cpu-cxl node distance is greater than cpu-to-cpu distances. Node 1 has the CXL memory in this case. CXL memory can also be identified using ACPI SRAT table and memory maps.
Feature description is available in the specification, "AMD64 Technology Platform Quality of Service Extensions, Revision: 1.03 Publication # 56375 Revision: 1.03 Issue Date: February 2022". Link: https://www.amd.com/en/support/tech-docs/amd64-technology-platform-quality-service-extensions
Affected parts
Motivation and Context
With this feature, the QOS enforcement policies can be applied to the external slow memory connected to the host. QOS enforcement is accomplished by assigning a Class Of Service (COS) to a processor and specifying allocations or limits for that COS for each resource to be allocated.
How Has This Been Tested?
Tested on AMD machine and sanity tested on Intel machine to verify for regression
Types of changes
Checklist: