<div>
                    <br>
                </div>
                <div><div><br></div><div>-- </div><div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);">Best regards </div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);">Eli</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);"><br></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);">天涯无处不重逢</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 14px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0); font-family: "Microsoft YaHei", Verdana, arial, sans-serif;">a leaf duckweed belongs to the sea, where not to meet in life </span></div></div><div>Sent with <a href="http://www.sparrowmailapp.com/?sig">Sparrow</a></div><div><br></div></div>
                 
                <p style="color: #A0A0A8;">On Wednesday, 15 March 2017 at 8:20 PM, Martin Kletzander wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div>On Mon, Mar 06, 2017 at 06:06:30PM +0800, Eli Qiao wrote:</div><blockquote type="cite"><div><div>This patch adds some utils struct and functions to expose resctrl</div><div>information.</div><div><br></div><div>virResCtrlAvailable: if resctrl interface exist on host.</div><div>virResCtrlGet: get specific type resource control information.</div><div>virResCtrlInit: initialize resctrl struct from the host's sys fs.</div><div>resctrlall[]: an array to maintain resource control information.</div><div><br></div><div>Some of host cpu related information methods was added in virhostcpu.c</div><div><br></div><div>Signed-off-by: Eli Qiao <<a href="mailto:liyong.qiao@intel.com">liyong.qiao@intel.com</a>></div><div>---</div><div>include/libvirt/virterror.h |   1 +</div><div>po/<a href="http://POTFILES.in">POTFILES.in</a>              |   1 +</div><div>src/<a href="http://Makefile.am">Makefile.am</a>             |   1 +</div><div>src/libvirt_private.syms    |   4 +</div><div>src/util/virerror.c         |   1 +</div><div>src/util/virhostcpu.c       | 186 ++++++++++++++++++++++++++++++++++++----</div><div>src/util/virhostcpu.h       |   6 ++</div><div>src/util/virresctrl.c       | 201 ++++++++++++++++++++++++++++++++++++++++++++</div><div>src/util/virresctrl.h       |  78 +++++++++++++++++</div><div>9 files changed, 462 insertions(+), 17 deletions(-)</div><div>create mode 100644 src/util/virresctrl.c</div><div>create mode 100644 src/util/virresctrl.h</div><div><br></div><div>diff --git a/src/util/virerror.c b/src/util/virerror.c</div><div>index ef17fb5..0ba15e6 100644</div><div>--- a/src/util/virerror.c</div><div>+++ b/src/util/virerror.c</div><div>@@ -139,6 +139,7 @@ VIR_ENUM_IMPL(virErrorDomain, VIR_ERR_DOMAIN_LAST,</div><div><br></div><div>              "Perf", /* 65 */</div><div>              "Libssh transport layer",</div><div>+              "Resouce Control",</div></div></blockquote><div><br></div><div>s/resouce/resource/</div><div><br></div><blockquote type="cite"><div><div>diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c</div><div>new file mode 100644</div><div>index 0000000..44a47cc</div><div>--- /dev/null</div><div>+++ b/src/util/virresctrl.c</div><div>@@ -0,0 +1,201 @@</div></div></blockquote><div><br></div><div>[...]</div><div><br></div><blockquote type="cite"><div><div>+</div><div>+static unsigned int host_id;</div><div>+</div><div>+static virResCtrl resctrlall[] = {</div><div>+    {</div><div>+        .name = "L3",</div><div>+        .cache_level = "l3",</div><div>+    },</div><div>+    {</div><div>+        .name = "L3DATA",</div><div>+        .cache_level = "l3",</div><div>+    },</div><div>+    {</div><div>+        .name = "L3CODE",</div><div>+        .cache_level = "l3",</div><div>+    },</div><div>+    {</div><div>+        .name = "L2",</div><div>+        .cache_level = "l2",</div><div>+    },</div><div>+};</div><div>+</div></div></blockquote><div><br></div><div>You are using global variables, still.  But I *still* see no locking.</div><div>What if yet another driver (not just QEMU) will want to use resctrl?</div><div>Bunch of these accesses can happen at the same time and break</div><div>everything.  How much of this information do we really need to keep (and</div><div>not reload)?</div><div><br></div></div></div></span></blockquote><div>Yes, we need to maintain a global one as /sys/fs/resctrl is a global one.</div><div><br></div><div>most of these information are in-mutble and don’t need to reload.</div><div> </div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;"><span><div><div><div></div><div>For example host_id can screw up a lot of things.  I might be discussing</div><div>in the latter patches as well.</div></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    yep. I see them.
                </div>