<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi Han,</p>
    <p>Thanks for your kind reminder. <br>
    </p>
    <p><br>
    </p>
    <p>I haven't used the 'virsh dommemstat' command for reporting the</p>
    <p> domain vcpus' memory bandwidth usage over host.  What I
      implemented</p>
    <p>is add a new option '--memory' under command 'virsh domstats'. <br>
    </p>
    <p><br>
    </p>
    <p>Reason for such kind of implementation is I haven't realized
      there is already</p>
    <p>one interface, the 'dommemstat' command, with the intention of
      showing</p>
    <p>domain memory related statistics. <br>
    </p>
    <p><br>
    </p>
    <p>But after examining the ways to report the block device
      statistics, and the</p>
    <p>network traffic statistics, I found they are similar,  for
      example you can</p>
    <p>find block device statistics from command 'virsh domblkstat' and
      <br>
    </p>
    <p>'virsh domstats --block'. <br>
    </p>
    <p><br>
    </p>
    <p>So I tent to use the way that I have done in patch '1/5' to let
      these memory</p>
    <p>information be shown in command 'virsh domstasts --memory'. <br>
    </p>
    <p>Reason is the memory bandwidth information is associated with the</p>
    <p>memory bandwidth monitor (a hardware feature from cpu
      manufacture), <br>
    </p>
    <p>and each monitor could be applied to one or some vcpus.  This is
      much</p>
    <p>similar to the case of 'virsh domstats --interface' and 'virsh
      domstats --block'.</p>
    <p><br>
    </p>
    <p>I hope more reviewers involve this discussion.<br>
    </p>
    <p><br>
    </p>
    <p>Thanks <br>
    </p>
    <p>Huaqiang<br>
    </p>
    <div class="moz-cite-prefix">On 2019/11/14 下午2:43, Han Han wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAHjf+S_02Fwc2niHhY7EDHhqaaqjBxFT-91KPCMf_V=ETjGFtg@mail.gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Just a reminder that libvirt binds need to be updated after
          patches introduced.</div>
        <div>Refer to libvirt python and perl bindings:</div>
        <div>commit b0a7747<br>
          Author: Pavel Hrdina <<a href="mailto:phrdina@redhat.com"
            moz-do-not-send="true">phrdina@redhat.com</a>><br>
          Date:   Fri Sep 20 11:14:35 2019 +0200<br>
          <br>
              virDomainMemoryStats: include disk caches<br>
              <br>
              Introduced in libvirt 4.6.0 by commit <aee04655089>.<br>
              <br>
              Resolves: <a
            href="https://bugzilla.redhat.com/show_bug.cgi?id=1683516"
            moz-do-not-send="true">https://bugzilla.redhat.com/show_bug.cgi?id=1683516</a><br>
              <br>
              Signed-off-by: Pavel Hrdina <<a
            href="mailto:phrdina@redhat.com" moz-do-not-send="true">phrdina@redhat.com</a>><br>
              Reviewed-by: Daniel P. Berrangé <<a
            href="mailto:berrange@redhat.com" moz-do-not-send="true">berrange@redhat.com</a>></div>
        <div><br>
        </div>
        <div>commit e562e58<br>
          Author: Daniel P. Berrangé <<a
            href="mailto:berrange@redhat.com" moz-do-not-send="true">berrange@redhat.com</a>><br>
          Date:   Wed May 22 14:07:57 2019 +0100<br>
          <br>
              Add new hugetlb memory stats constants<br>
              <br>
              Signed-off-by: Daniel P. Berrangé <<a
            href="mailto:berrange@redhat.com" moz-do-not-send="true">berrange@redhat.com</a>><br>
        </div>
        <br>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Wed, Nov 13, 2019 at 6:34
          PM Wang Huaqiang <<a href="mailto:huaqiang.wang@intel.com"
            moz-do-not-send="true">huaqiang.wang@intel.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">RDT
          is the short for Intel Resource Director Technology, consists<br>
          of four sub-technologies until now:<br>
          <br>
              -. CAT for cache allocation<br>
              -. CMT for cache usage monitoring<br>
              -. MBA for memory bandwidth allocation<br>
              -. MBM for memory bandwidth usage monitoring<br>
          <br>
          The Linux kernel interface is 'resctrl' file system, and we
          have<br>
          already implemented the support of CAT, CMT and MBA, to
          accomplish<br>
          the tasks such as allocating a part of shared CPU last level
          cache<br>
          to particular domain vcpu or a list of vcpus and monitoring
          the<br>
          usage of cache, or the task of allocating a mount of memory<br>
          bandwidth to specify domain vcpu(s).<br>
          <br>
          This series is to introduce the support of MBM.<br>
          <br>
          Basically the interfaces are:<br>
          <br>
          ** Identify host capability **<br>
          <br>
          Similar to identify the host capability of CMT, it could be
          gotten<br>
          through the result of 'virsh capabilities', if following
          elements<br>
          are found, then MBM is supported:<br>
          <br>
              <memory_bandwidth><br>
                <monitor maxMonitors='176'><br>
                  <feature name='mbm_total_bytes'/><br>
                  <feature name='mbm_local_bytes'/><br>
                </monitor><br>
              </memory_bandwidth><br>
          <br>
          'mbm_total_bytes' means supporting to report the memory
          bandwidth<br>
          used by the vcpu(s) of specific monitor on all CPU sockets.<br>
          <br>
          'mbm_local_bytes' means supporting to report the memory
          bandwidth<br>
          used by vcpu(s) that is passing through local CPU socket.<br>
          <br>
          ** Create monitor group**<br>
          <br>
          The monitor group for specific domain vcpus, for example vcpu
          0-4,<br>
          is defined in domain configuration file, in such kind of way:<br>
          <br>
            <cputune><br>
              <memorytune vcpus='0-4'><br>
                <monitor vcpus='0-4'/><br>
              </memorytune><br>
            </cputune><br>
          <br>
          ** Report memory usage **<br>
          <br>
          Introduced an option '--memory' against 'virsh domstats'
          command<br>
          to show the memory bandwidth usage in such way:<br>
          (also very similar to the format of CMT result.)<br>
          <br>
              # virsh domstats --memory<br>
          <br>
              Domain: 'libvirt-vm'<br>
                  memory.bandwidth.monitor.count=4<br>
                  <a href="http://memory.bandwidth.monitor.0.name"
            rel="noreferrer" target="_blank" moz-do-not-send="true">memory.bandwidth.monitor.0.name</a>=vcpus_0-4<br>
                  memory.bandwidth.monitor.0.vcpus=0-4<br>
                  memory.bandwidth.monitor.0.node.count=2<br>
                  <a href="http://memory.bandwidth.monitor.0.node.0.id"
            rel="noreferrer" target="_blank" moz-do-not-send="true">memory.bandwidth.monitor.0.node.0.id</a>=0<br>
                 
          memory.bandwidth.monitor.0.node.0.bytes.total=14201651200<br>
                 
          memory.bandwidth.monitor.0.node.0.bytes.local=7369809920<br>
                  <a href="http://memory.bandwidth.monitor.0.node.1.id"
            rel="noreferrer" target="_blank" moz-do-not-send="true">memory.bandwidth.monitor.0.node.1.id</a>=1<br>
                 
          memory.bandwidth.monitor.0.node.1.bytes.total=188897640448<br>
                 
          memory.bandwidth.monitor.0.node.1.bytes.local=170044047360<br>
          <br>
          <br>
          Huaqiang (5):<br>
            util, resctrl: using 64bit interface instead of 32bit for
          counters<br>
            conf: showing cache/memoryBW monitor features in
          capabilities<br>
            cachetune schema: a looser check for the order of
          <cache> and<br>
              <monitor> element<br>
            conf: Parse dommon configure file for memorytune monitors<br>
            virsh: show memoryBW info in 'virsh domstats' command<br>
          <br>
           docs/schemas/domaincommon.rng              |  91
          +++++++++---------<br>
           include/libvirt/libvirt-domain.h           |   1 +<br>
           src/conf/capabilities.c                    |   4 +-<br>
           src/conf/domain_conf.c                     |  44 +++++++--<br>
           src/libvirt-domain.c                       |  21 +++++<br>
           src/qemu/qemu_driver.c                     | 103
          ++++++++++++++++++++-<br>
           src/util/virfile.c                         |  40 ++++++++<br>
           src/util/virfile.h                         |   2 +<br>
           src/util/virresctrl.c                      |   6 +-<br>
           src/util/virresctrl.h                      |   2 +-<br>
           tests/genericxml2xmlindata/cachetune.xml   |   1 +<br>
           tests/genericxml2xmlindata/memorytune.xml  |   5 +<br>
           tests/genericxml2xmloutdata/cachetune.xml  |  34 +++++++<br>
           tests/genericxml2xmloutdata/memorytune.xml |  42 +++++++++<br>
           tests/genericxml2xmltest.c                 |   4 +-<br>
           tools/virsh-domain-monitor.c               |   7 ++<br>
           tools/virsh.pod                            |  23 ++++-<br>
           17 files changed, 367 insertions(+), 63 deletions(-)<br>
           create mode 100644 tests/genericxml2xmloutdata/cachetune.xml<br>
           create mode 100644 tests/genericxml2xmloutdata/memorytune.xml<br>
          <br>
          -- <br>
          2.23.0<br>
          <br>
          <br>
          --<br>
          libvir-list mailing list<br>
          <a href="mailto:libvir-list@redhat.com" target="_blank"
            moz-do-not-send="true">libvir-list@redhat.com</a><br>
          <a href="https://www.redhat.com/mailman/listinfo/libvir-list"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://www.redhat.com/mailman/listinfo/libvir-list</a><br>
          <br>
        </blockquote>
      </div>
      <br clear="all">
      <br>
      -- <br>
      <div dir="ltr" class="gmail_signature">
        <div dir="ltr">
          <div>
            <div dir="ltr">
              <div>
                <div dir="ltr">Best regards,</div>
                <div dir="ltr">-----------------------------------<br>
                </div>
                <div dir="ltr">Han Han<br>
                  Quality Engineer<br>
                  Redhat.<br>
                  <br>
                  Email: <a href="mailto:hhan@redhat.com"
                    target="_blank" moz-do-not-send="true">hhan@redhat.com</a><br>
                  Phone: +861065339333<br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
  </body>
</html>