Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring the Cache

You can configure VM cache in an XML file. The MPAM feature can limit the number of cache lines used by a process based on XML configuration parameters.

Example cache configurations:

1
2
3
4
5
6
<cputune>
    <cachetune vcpus='0-15'>
      <cache id='0' level='3' type='both' size='2560' unit='KiB'/>
      <cache id='0' level='3' type='priority' size='2'/>
    </cachetune>
</cputune>

Parameter description:

  • vcpus: list of vCPUs to be limited.
  • id: NUMA ID.
  • level: cache level. Currently, only L3 is supported.
  • type: parameter type. Valid values include both, code, data, and priority, corresponding to L3, L3CODE, L3DATA, and L3PRI in MPAM, respectively.
  • size: If type is set to priority, this parameter indicates the priority value, ranging from 0 to 3. When type is set to other values, size and unit together determine the cache line size.
  • unit: This parameter is left blank when type is set to priority. If type is set to other values, this parameter specifies the unit of the cache line size. The value can be KiB (default), MiB, or GiB.
  • The configured cache line size must be an integer multiple of the size of a single cache line on the physical machine (the latter can be obtained by dividing the L3 cache size of a single NUMA node in the /sys/fs/resctrl/size file by the number of L3 cache mask bits of a single NUMA node in the /sys/fs/resctrl/schemata file). As shown in the following figures, the L3 cache size of a single NUMA node is 58,720,256 bytes, and the number of mask bits is 28. Therefore, the size of a single cache line is 58,720,256 divided by 28, that is, 2,097,152 bytes (2 MiB).