<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br>
> which shows each socket has its own dedicated L3 cache, and each<br>
> core has its own L2 & L1 cache.<br>
<br>
</div></div>We need to also include the host cache ID value in the XML to<br>
let us reliably distinguish / associate with differet cache<br>
banks when placing guests, if there's multiple caches of the<br>
same type associated with the same CPU.<br>
<br>
     <cache><br>
       <bank id="0" type="l3" size="56320" units="KiB" cpus="0,2,3,6,7,8"/><br>
       <bank id="1" type="l3" size="56320" units="KiB" cpus="0,2,3,6,7,8"/><br>
       <bank id="2" type="l3" size="56320" units="KiB" cpus="3,4,5,9,10,11"/><br>
       <bank id="3" type="l3" size="56320" units="KiB" cpus="3,4,5,9,10,11"/><br>
       <bank id="4" type="l2" size="256" units="KiB" cpus="0"/><br>
       ....<br>
     </cache><br>
<span class=""><br>
<br>
<br>
> > 3. Add new virsh command 'nodecachestats':<br>
> > This API is to expose vary cache resouce left on each hardware (cpu socket).<br>
> ><br>
> > It will be formated as:<br>
> ><br>
> > <resource_type>.<resource_id>: left size KiB<br>
> ><br>
> > for example I have a 2 socket cpus host, and I'v enabled cat_l3 feature only<br>
> ><br>
> > root@s2600wt:~/linux# virsh nodecachestats<br>
> > L3.0 : 56320 KiB<br>
> > L3.1 : 56320 KiB<br>
> ><br>
> >   P.S. resource_type can be L3, L3DATA, L3CODE, L2 for now.<br>
><br>
> This feels like something we should have in the capabilities XML too<br>
> rather than a new command<br>
><br>
>     <cache><br>
>       <bank type="l3" size="56320" units="KiB" cpus="0,2,3,6,7,8"><br>
>           <control unit="KiB" min="2816" avail="56320/><br>
>       </bank><br>
>       <bank type="l3" size="56320" units="KiB" cpus="3,4,5,9,10,11"><br>
>           <control unit="KiB" min="2816" avail="56320"/><br>
>       </bank><br>
>     </cache><br>
<br>
</span>Opps, ignore this. I remember the reason we always report available<br>
resource separately from physically present resource, is that we<br>
don't want to re-generate capabilities XML every time available<br>
resource changes.<br>
<br>
So, yes, we do need some API like  virNodeFreeCache()  / virs nodefreecache<br></blockquote><div><br></div><div>yes, we need this.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We probably want to use an 2d array of typed parameters. The first level of<br>
the array would represent the cache bank, the second level woudl represent<br>
the parameters for that bank. eg if we had 3 cache banks, we'd report a<br>
3x3 typed parameter array, with parameters for the cache ID, its type and<br>
the available / free size<br>
<br>
   id=0<br>
   type=l3<br>
   avail=56320<br>
<br>
   id=1<br>
   type=l3<br>
   avail=56320<br>
<br>
   id=2<br>
   type=l3<br>
   avail=56320<br>
<div class="HOEnZb"><div class="h5"><br>
Regards,<br>
Daniel<br>
--<br>
|: <a href="http://berrange.com" rel="noreferrer" target="_blank">http://berrange.com</a>      -o-    <a href="http://www.flickr.com/photos/dberrange/" rel="noreferrer" target="_blank">http://www.flickr.com/photos/<wbr>dberrange/</a> :|<br>
|: <a href="http://libvirt.org" rel="noreferrer" target="_blank">http://libvirt.org</a>              -o-             <a href="http://virt-manager.org" rel="noreferrer" target="_blank">http://virt-manager.org</a> :|<br>
|: <a href="http://entangle-photo.org" rel="noreferrer" target="_blank">http://entangle-photo.org</a>       -o-    <a href="http://search.cpan.org/~danberr/" rel="noreferrer" target="_blank">http://search.cpan.org/~<wbr>danberr/</a> :|<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Best regards </div><div>- Eli</div><div><br></div><div>天涯无处不重逢</div><div><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><br></div></div></div></div></div>
</div></div>