<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Sun, Jul 5, 2015 at 5:13 PM, Qiaowei Ren <span dir="ltr"><<a href="mailto:qiaowei.ren@intel.com" target="_blank">qiaowei.ren@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">One RFC in<br>
<a href="https://www.redhat.com/archives/libvir-list/2015-June/msg01509.html" rel="noreferrer" target="_blank">https://www.redhat.com/archives/libvir-list/2015-June/msg01509.html</a><br>
<br>
CMT (Cache Monitoring Technology) can be used to measure the<br>
usage of cache by VM running on the host. This patch will<br>
extend the bulk stats API (virDomainListGetStats) to add this<br>
field. Applications based on libvirt can use this API to achieve<br>
cache usage of VM. Because CMT implementation in Linux kernel<br>
is based on perf mechanism, this patch will enable perf event<br>
for CMT when VM is created and disable it when VM is destroyed.<br>
<br></blockquote><div><br></div><div>Hi Ren,<br></div><div>One query wrt this implementation. I see you make a perf ioctl to gather CMT stats each time the stats API is invoked.<br></div><div>If the CMT stats are exposed by a hardware counter, then this implies logging on a per-cpu (or per-socket ???) basis.<br></div><div>This also implies that the value read will vary as the CPU (or socket) on which it is being called changes.<br></div><div><br></div><div>Now, with this background, if we need real-world stats on a VM, we need this perf ioctl executed on all CPUs/ sockets on which the VM ran. Also, once done, we will need to aggregate results from each of these sources.<br><br></div><div>In this implementation, I am missing this -- there seems no control over which physical CPU the libvirt worker thread will run and collect the perf data from. Data collected from this implementation might not accurately model the system state.<br></div><div>I _think_ libvirt currently has no way of directing a worker thread to collect stats from a given CPU -- if we do, I would be happy to learn about it :)<br></div><div><br></div></div>Regards,<br></div><div class="gmail_extra">Prerna<br></div></div>