<div>
                    <br>
                </div>
                <div><div><br></div><div>-- </div><div>Eli Qiao</div><div>Sent with <a href="http://www.sparrowmailapp.com/?sig">Sparrow</a></div><div><br></div></div>
                  
                <p style="color: #A0A0A8;">On Tuesday, 7 February 2017 at 3:03 AM, Marcelo Tosatti wrote:</p><blockquote type="cite"><div>
                    <span><div><div><div>On Mon, Feb 06, 2017 at 01:33:09PM -0200, Marcelo Tosatti wrote:</div><blockquote type="cite"><div><div>On Mon, Feb 06, 2017 at 10:23:35AM +0800, Eli Qiao wrote:</div><blockquote type="cite"><div><div>This series patches are for supportting CAT featues, which also</div><div>called cache tune in libvirt.</div><div><br></div><div>First to expose cache information which could be tuned in capabilites XML.</div><div>Then add new domain xml element support to add cacahe bank which will apply</div><div>on this libvirt domain.</div><div><br></div><div>This series patches add a util file `resctrl.c/h`, an interface to talk with</div><div>linux kernel's sys fs.</div><div><br></div><div>There are still some TODOs such as expose new public interface to get free</div><div>cache information.</div><div><br></div><div>Some discussion about this feature support can be found from:</div><div><a href="https://www.redhat.com/archives/libvir-list/2017-January/msg00644.html">https://www.redhat.com/archives/libvir-list/2017-January/msg00644.html</a></div></div></blockquote><div><br></div><div>Two comments:</div><div><br></div><div>1) Please perform appropriate filesystem locking when accessing</div><div>resctrlfs, as described at:</div><div><br></div><div><a href="http://www.spinics.net/lists/linux-tip-commits/msg36754.html">http://www.spinics.net/lists/linux-tip-commits/msg36754.html</a></div></div></blockquote></div></div></span></div></blockquote><div><br></div><div>Sure. </div><blockquote type="cite"><div><span><div><div><blockquote type="cite"><div><div><br></div><div>2) </div><div><br></div><div>    <cachetune id='10' host_id='1' type='l3' size='3072' unit='KiB'/></div><div><br></div><div>[b4c270b5-e0f9-4106-a446-69032872ed7d]# cat tasks  </div><div>8654</div><div>[b4c270b5-e0f9-4106-a446-69032872ed7d]# pstree -p | grep qemu</div><div>           |-qemu-kvm(8654)-+-{qemu-kvm}(8688)</div><div>           |                |-{qemu-kvm}(8692)</div><div>           |                `-{qemu-kvm}(8693)</div><div><br></div><div>Should add individual vcpus to the "tasks" file, not the main QEMU</div><div>process.</div><div><br></div><div>The NFV usecase requires exclusive CAT allocation for the vcpu which</div><div>runs the sensitive workload.</div><div><br></div><div>Perhaps:</div><div><br></div><div>    <cachetune id='10' host_id='1' type='l3' size='3072' unit='KiB'/> </div><div><br></div><div>Adds all vcpus that are pinned to the socket which cachebank with</div><div>host_id=1.</div><div><br></div><div>    <cachetune id='10' host_id='1' type='l3' size='3072' unit='KiB' vcpus=2,3/> </div><div><br></div><div>Adds PID of vcpus 2 and 3 to resctrl directory created for this</div><div>allocation.</div></div></blockquote><div><br></div></div></div></span></div></blockquote><div>Hmm.. in this case, we need to figure out what’s the pid of vcpus=2 and vcpu=3 and added them to the resctrl directory.</div><div>currently, I create a resctrl directory(called resctrl domain) for a VM so just put all task ids to it.</div><div><br></div><div>this is my though:</div><div><br></div><div>let say the vm has vcpus=0 1 2 3, and you want to let 0, 1 benefit cache on host_id=0, and 2, 3 on host_id=1</div><div><br></div><div>you will do:</div><div><br></div><div>1)</div><div>    pin vcpus 0, 1 on the cpus of socket 0 </div><div>    pin vcpus 2, 3 on the cpus of socket 1</div><div>this can be done in vcputune</div><div><br></div><div>2) define cache tune like this:</div><div><cachetune id='0' host_id=‘0' type='l3' size='3072' unit='KiB'/></div><div><cachetune id='1' host_id='1' type='l3' size='3072' unit='KiB'/></div><div><br></div><div>in libvirt:</div><div>we create a resctrl directory naming with the VM’s uuid</div><div>and set schemata for each socket 0, and socket 1, put all qemu tasks ids into tasks file, this will work fine. </div><div>please be note that in a resctrl directory, we can define schemata for each socket id separately.</div><div> </div><div> </div><blockquote type="cite"><div><span><div><div><div>3) CDP / non-CDP convertion.</div><div><br></div><div>In case the size determination has been performed with non-CDP,</div><div>to emulate such allocation on a CDP host,</div><div>it would be good to allow both code and data allocations to share</div><div>the CBM space: </div><div><br></div></div></div></span></div></blockquote><div>IOM, I don’t think it’s good to have this.</div><div>in libvirt capabilities xml, the application will get to know if the host support cdp or not.</div><div> </div><blockquote type="cite"><div><span><div><div><div><br></div><div>     <cachetune id='10' host_id='1' type='l3data' size='3072' unit='KiB'/></div><div>     <cachetune id='10' host_id='1' type='l3code' size='3072' unit='KiB'/></div><div><br></div><div>Perhaps if using the same ID?</div></div></div></span></div></blockquote><div>I am open to hear about what other’s say, </div><div> </div><blockquote type="cite"><div><span><div><div><div> </div><div><br></div><div>Other than that, testing looks good.</div></div></div></span>
                  
                  
                  
                  
                </div></blockquote><div>
                    Thanks for the testing.
                </div><div><br></div><div><br></div>