<div dir="ltr"><div><div><div>Hi Ren,<br></div>Thank you for clarifying. I really do not have any more comments on the patch.<br><br></div>Regards,<br></div>Prerna<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 9, 2015 at 12:27 PM, Ren, Qiaowei <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"><div class="HOEnZb"><div class="h5">On Jul 7, 2015 15:51, Ren, Qiaowei wrote:<br>
><br>
><br>
> On Jul 6, 2015 14:49, Prerna wrote:<br>
><br>
>> On Sun, Jul 5, 2015 at 5:13 PM, Qiaowei Ren <<a href="mailto:qiaowei.ren@intel.com">qiaowei.ren@intel.com</a><br>
>> <mailto:<a href="mailto:qiaowei.ren@intel.com">qiaowei.ren@intel.com</a>> > wrote:<br>
>><br>
>><br>
>>      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>
>><br>
>><br>
>><br>
>> Hi Ren,<br>
>><br>
>> One query wrt this implementation. I see you make a perf ioctl to<br>
>> gather CMT stats each time the stats API is invoked.<br>
>><br>
>> If the CMT stats are exposed by a hardware counter, then this implies<br>
>> logging on a per-cpu (or per-socket ???) basis.<br>
>><br>
>> This also implies that the value read will vary as the CPU (or socket)<br>
>> on which it is being called changes.<br>
>><br>
>><br>
>> Now, with this background, if we need real-world stats on a VM, we need<br>
>> this perf ioctl executed on all CPUs/ sockets on which the VM ran.<br>
>> Also, once done, we will need to aggregate results from each of these<br>
>> sources.<br>
>><br>
>><br>
>> In this implementation, I am missing this -- there seems no control<br>
>> over which physical CPU the libvirt worker thread will run and collect<br>
>> the perf data from. Data collected from this implementation might not<br>
>> accurately model the system state.<br>
>><br>
>> I _think_ libvirt currently has no way of directing a worker thread to<br>
>> collect stats from a given CPU -- if we do, I would be happy to learn<br>
>> about it :)<br>
>><br>
><br>
> Prerna, thanks for your reply. I checked the CMT implementation in<br>
> kernel, and noticed that the series implement new ->count() of pmu<br>
> driver which can aggregate the results from each cpu if perf type is<br>
> PERF_TYPE_INTEL_CQM . The following is the link for the patch:<br>
> <a href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?i" rel="noreferrer" target="_blank">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?i</a><br>
> d=bfe1fc d2688f557a6b6a88f59ea7619228728bd7<br>
><br>
> So I guess that this patch just need to set right perf type and "cpu=-1". Do you<br>
> think this is ok?<br>
><br>
<br>
</div></div>Hi Prerna,<br>
<br>
Do you have more comments on this patch series? I would be glad to update my implementation. ^-^<br>
<span class="HOEnZb"><font color="#888888"><br>
Qiaowei<br>
<br>
</font></span></blockquote></div><br></div>