RDT is the short for Intel Resource Director Technology, consists
of four sub-technologies until now:
-. CAT for cache allocation
-. CMT for cache usage monitoring
-. MBA for memory bandwidth allocation
-. MBM for memory bandwidth usage monitoring
The Linux kernel interface is 'resctrl' file system, and we have
already implemented the support of CAT, CMT and MBA, to accomplish
the tasks such as allocating a part of shared CPU last level cache
to particular domain vcpu or a list of vcpus and monitoring the
usage of cache, or the task of allocating a mount of memory
bandwidth to specify domain vcpu(s).
This series is to introduce the support of MBM.
Basically the interfaces are:
** Identify host capability **
Similar to identify the host capability of CMT, it could be gotten
through the result of 'virsh capabilities', if following elements
are found, then MBM is supported:
<memory_bandwidth>
<monitor maxMonitors='176'>
<feature name='mbm_total_bytes'/>
<feature name='mbm_local_bytes'/>
</monitor>
</memory_bandwidth>
'mbm_total_bytes' means supporting to report the memory bandwidth
used by the vcpu(s) of specific monitor on all CPU sockets.
'mbm_local_bytes' means supporting to report the memory bandwidth
used by vcpu(s) that is passing through local CPU socket.
** Create monitor group**
The monitor group for specific domain vcpus, for example vcpu 0-4,
is defined in domain configuration file, in such kind of way:
<cputune>
<memorytune vcpus='0-4'>
<monitor vcpus='0-4'/>
</memorytune>
</cputune>
** Report memory usage **
Introduced an option '--memory' against 'virsh domstats' command
to show the memory bandwidth usage in such way:
(also very similar to the format of CMT result.)
# virsh domstats --memory
Domain: 'libvirt-vm'
memory.bandwidth.monitor.count=4
memory.bandwidth.monitor.0.name=vcpus_0-4
memory.bandwidth.monitor.0.vcpus=0-4
memory.bandwidth.monitor.0.node.count=2
memory.bandwidth.monitor.0.node.0.id=0
memory.bandwidth.monitor.0.node.0.bytes.total=14201651200
memory.bandwidth.monitor.0.node.0.bytes.local=7369809920
memory.bandwidth.monitor.0.node.1.id=1
memory.bandwidth.monitor.0.node.1.bytes.total=188897640448
memory.bandwidth.monitor.0.node.1.bytes.local=170044047360
Huaqiang (5):
util, resctrl: using 64bit interface instead of 32bit for counters
conf: showing cache/memoryBW monitor features in capabilities
cachetune schema: a looser check for the order of <cache> and
<monitor> element
conf: Parse dommon configure file for memorytune monitors
virsh: show memoryBW info in 'virsh domstats' command
docs/schemas/domaincommon.rng | 91 +++++++++---------
include/libvirt/libvirt-domain.h | 1 +
src/conf/capabilities.c | 4 +-
src/conf/domain_conf.c | 44 +++++++--
src/libvirt-domain.c | 21 +++++
src/qemu/qemu_driver.c | 103 ++++++++++++++++++++-
src/util/virfile.c | 40 ++++++++
src/util/virfile.h | 2 +
src/util/virresctrl.c | 6 +-
src/util/virresctrl.h | 2 +-
tests/genericxml2xmlindata/cachetune.xml | 1 +
tests/genericxml2xmlindata/memorytune.xml | 5 +
tests/genericxml2xmloutdata/cachetune.xml | 34 +++++++
tests/genericxml2xmloutdata/memorytune.xml | 42 +++++++++
tests/genericxml2xmltest.c | 4 +-
tools/virsh-domain-monitor.c | 7 ++
tools/virsh.pod | 23 ++++-
17 files changed, 367 insertions(+), 63 deletions(-)
create mode 100644 tests/genericxml2xmloutdata/cachetune.xml
create mode 100644 tests/genericxml2xmloutdata/memorytune.xml
--
2.23.0