<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Courier New";
        panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:Calibri;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Calibri;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Calibri;
        color:windowtext;
        font-weight:normal;
        font-style:normal;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:595.0pt 842.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:314727399;
        mso-list-template-ids:-312018108;}
@list l0:level1
        {mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1
        {mso-list-id:1250190241;
        mso-list-template-ids:-1248565276;}
@list l1:level1
        {mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l2
        {mso-list-id:1562600533;
        mso-list-template-ids:-1358106332;}
@list l2:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l2:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l2:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l2:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l2:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l2:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l2:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l2:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l2:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l3
        {mso-list-id:1999840930;
        mso-list-template-ids:-1028092236;}
@list l3:level1
        {mso-level-start-at:2;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l3:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l4
        {mso-list-id:2013606014;
        mso-list-template-ids:765503894;}
@list l4:level1
        {mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l4:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l4:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l4:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l4:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l4:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l4:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l4:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l4:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l5
        {mso-list-id:2031106371;
        mso-list-template-ids:307236488;}
@list l5:level1
        {mso-level-start-at:3;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l5:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l5:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l5:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l5:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l5:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l5:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l5:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l5:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2 lfo2
        {mso-level-number-format:alpha-lower;
        mso-level-numbering:continue;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;}
@list l0:level2 lfo3
        {mso-level-number-format:alpha-lower;
        mso-level-numbering:continue;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;}
@list l0:level3 lfo3
        {mso-level-number-format:roman-lower;
        mso-level-numbering:continue;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:0cm;
        text-indent:0cm;}
@list l3:level1 lfo6
        {mso-level-numbering:continue;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;}
@list l5:level1 lfo7
        {mso-level-numbering:continue;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:0cm;
        text-indent:0cm;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt"> Hi folks</span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I would like to start a discussion about how to support a new cpu feature in libvirt. CAT support is not fully merged into linux kernel yet, the target release is 4.10, and all patches has been merged into
 linux tip branch. So there won’t be interface/design changes.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">## Background</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
Intel RDT is a toolkit to do resource Qos  for cpu such as llc(l3) cache, memory bandwidth usage, these fine granularity resource control features are very useful in a cloud environment which will run logs of noisy instances.<br>
Currently, Libvirt has supported CAT/MBMT/MBML already, they are only for resource usage monitor, propose to supporting CAT to control VM’s l3 cache quota.<br>
<br>
<br>
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
## CAT interface in kernel</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
In kernel, a new resource interface has been introduced under /sys/fs/resctrl, it’s used for resource control, for more information, refer</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Intel_rdt_ui [ <a href="https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/tree/Documentation/x86/intel_rdt_ui.txt?h=x86/cache">
https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/tree/Documentation/x86/intel_rdt_ui.txt?h=x86/cache</a> ]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
<br>
Kernel requires to provide schemata for l3 cache before add a task to a new partition, these interface is too much detail for a virtual machine user, so propose to let Libvirt manage schemata on the host.<br>
<br>
<br>
<br>
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">## What will libvirt do? <br>
<br>
<br>
<br>
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">### Questions:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
To enable CAT support in libvirt, we need to think about follow questions<br>
<br>
<br>
<br>
</span><o:p></o:p></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoNormal" style="mso-list:l0 level1 lfo1"><span style="font-size:11.0pt">Only set CAT when an VM has CPU pin, which is to say, l3 cache is per cpu socket resources. On a host which has 2 cpu sockets, each cpu socket has it own cache, and can not
 be shared..</span><o:p></o:p></li><li class="MsoNormal" style="mso-list:l0 level1 lfo1"><span style="font-size:11.0pt">What the cache allocation policy should be used, this will be looks like:</span><o:p></o:p></li></ol>
<p class="MsoNormal" style="margin-left:36.0pt;text-indent:0cm;mso-list:l0 level2 lfo2">
<![if !supportLists]><span style="mso-list:Ignore">a.<span style="font:7.0pt "Times New Roman"">                 
</span></span><![endif]><span style="font-size:11.0pt">VM has it’s own dedicated l3 cache and also can share other l3 cache.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt;text-indent:0cm;mso-list:l0 level2 lfo2">
<![if !supportLists]><span style="mso-list:Ignore">b.<span style="font:7.0pt "Times New Roman"">                 
</span></span><![endif]><span style="font-size:11.0pt">VM can only use the caches which allocated to it.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt;text-indent:0cm;mso-list:l0 level2 lfo2">
<![if !supportLists]><span style="mso-list:Ignore">c.<span style="font:7.0pt "Times New Roman"">                  
</span></span><![endif]><span style="font-size:11.0pt">Has some pre-defined policies and priority for a VM</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:108.0pt"><span style="font-size:11.0pt">Like COB [1]</span><o:p></o:p></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoNormal" style="mso-list:l0 level1 lfo3"><span style="font-size:11.0pt">Should reserve some l3 cache for host’s system usage (related to 2)</span><o:p></o:p></li><li class="MsoNormal" style="mso-list:l0 level1 lfo3"><span style="font-size:11.0pt">What’s the unit for l3 cache allocation? (related to 2)</span><o:p></o:p></li></ol>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">### Propose Changes</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">XML domain user interface changes:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Option 1: explicit specify cache allocation for a VM</span><o:p></o:p></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt"> </span></b><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><i><span style="font-size:11.0pt">1 work with numa node</span></i><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"><br>
Some cloud orchestration software use numa + vcpu pin together, so we can enable cat supporting with numa infra.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Expose how many l3 cache a VM want to reserved and we require that the l3 cache should be bind on some specify cpu socket, just like what we did for numa node.<br>
<br>
This is an domain xml example which is generated by OpenStack Nova for allocate llc(l3 cache) when booting a new VM<br>
<br>
<domain><br>
…<br>
 <cputune><br>
   <vcpupin vcpu='0' cpuset='19'/><br>
   <vcpupin vcpu='1' cpuset='63'/><br>
   <vcpupin vcpu='2' cpuset='83'/><br>
   <vcpupin vcpu='3' cpuset='39'/><br>
   <vcpupin vcpu='4' cpuset='40'/><br>
   <vcpupin vcpu='5' cpuset='84'/><br>
   <emulatorpin cpuset='19,39-40,63,83-84'/><br>
 </cputune><br>
...<br>
 <cpu mode='host-model'><br>
   <model fallback='allow'/><br>
   <topology sockets='3' cores='1' threads='2'/><br>
   <numa><br>
     <cell id='0' cpus='0-1' memory='2097152' l3cache='1408' unit='KiB'/><br>
     <cell id='1' cpus='2-5' memory='4194304' l3cache='5632' unit='KiB'/><br>
   </numa><br>
 </cpu><br>
...<br>
</domain><br>
<br>
Refer to [<a href="http://libvirt.org/formatdomain.html#elementsCPUTuning">http://libvirt.org/formatdomain.html#elementsCPUTuning</a>]<br>
<br>
<br>
<br>
</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">So finally we can calculate on which CPU socket(cell) we need to allocate how may l3cache for a VM.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><i><span style="font-size:11.0pt">2. work with vcpu pin</span></i><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Forget numa part, CAT setting should have relationship with cpu core setting, we can apply CAT policy if VM has set cpu pin setting (only VM won’t be schedule to another CPU sockets)</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Cache allocation on which CPU socket can be calculate as just as 1.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">We may need to enable both 1 and 2.
</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">There are several policy for cache allocation:</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Let’ take some examples:</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">For intel e5 v4 2699(Signal socket), there are 55M l3 cache on the chip , the default of L3 schemata is L3:0=ffffff , it represents to use 20 bit to control l3 cache, each bit will
 represent 2.75M, which will be the minimal unit on this host.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">The allocation policy could be 3 policies :</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:90.0pt;text-indent:-18.0pt;mso-list:l4 level1 lfo4">
<![if !supportLists]><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span style="font-size:11.0pt">One priority VM:</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">A priority import VM can be allocated a dedicated amount l3 cache (let’s say 2.75 * 4 = 11M) and it can also reach the left 44 M cache which will be shared with other process and
 VM on the same host. </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">So that we need to create a new ‘Partition’ n-20371</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">root@s2600wt:/sys/fs/resctrl# ls</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">cpus  info  n-20371  schemata  tasks</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">Inside of n-20371 directory:</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">root@s2600wt:/sys/fs/resctrl# ls n-20371/</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">cpus  schemata  tasks</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">The schemata content  will be L3:0=fffff
</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">The tasks content will be the pids of that VM</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">Along we need to change the default schemata of system:</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">root@s2600wt:/sys/fs/resctrl# cat schemata</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">L3:0=ffff # which can not use the highest 4 bits, only tasks in  n-20371 can reach that.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">In this design , we can only get 1 priority VM.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">Let’s change it a bit to have 2 VMs</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">The schemata of the 2 VMs could be:</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:90.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo5">
<![if !supportLists]><span style="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span style="font-size:11.0pt">L3:0=ffff0 # could not use the 4 low bits 11M l3 cache</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:90.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo5">
<![if !supportLists]><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span style="font-size:11.0pt">L3:0=0ffff # could not use the 4 high bits 11M l3 cache<br>
<br>
<br>
<br>
</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">Default schemata changes to</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">L3:0=0fff0 # default system process could only use the middle 33M l3 cache</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt;text-indent:0cm;mso-list:l3 level1 lfo6">
<![if !supportLists]><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span style="font-size:11.0pt">Isolated l3 cache dedicated allocation for each VM(if required)</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">A VM can only use the cache allocated to it.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">For example</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">VM 1 requires to allocate 11 M
</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">It’s schemata will be L3:0=f0000  #
</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">VM 2 requires to allocate 11M</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">It’s schemata will be L3:0=f000</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">And default schemata will be L3:0=fff</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">In this case, we can create multiple VMs which each of them can have dedicated l3 cache.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">The disadvantage is that we the allocated cache could be not be shared efficiently.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt;text-indent:0cm;mso-list:l5 level1 lfo7">
<![if !supportLists]><span style="mso-list:Ignore">3.<span style="font:7.0pt "Times New Roman"">     
</span></span><![endif]><span style="font-size:11.0pt">Isolated l3 cache shared allocation for each VM(if required by user)</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">In this case, we will put some VMs (which consider as noisy neighbors) to a ‘Partition’, restrict them to use the only caches allocated to them, by do this, other much more priority
 VM can be ensure to have enough l3 cache</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:54.0pt"><span style="font-size:11.0pt">Then we should decide how much cache the noisy group should have, and put all of their pids in that tasks file.
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
<br>
<br>
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Option 2: set cache priority  and apply policies</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Don’t specify cache amount at all, only define cache usage priority when define a VM domain XML.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Cache priority will decide how much the VM can use l3 cache on a host, it’s not a quantized.  So user don’t need to think about how much cache it should have when define a domain
 XML.</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Libvirt will decide cache allocation by the priority of VM defined and policies using.  </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Disadvantage is that caches ability on different host may be different. Same VM domain XML on different host may have vary caches allocation amount.  </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"># Support CAT in libvirt itself or leverage other software</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">COB</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">COB is Intel Cache Orchestrator Balancer (COB). please refer
<a href="http://clrgitlab.intel.com/rdt/cob/tree/master">http://clrgitlab.intel.com/rdt/cob/tree/master</a></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">COB supports some pre-defined policies, it will monitor cpu/cache/cache missing and do cache allocation based on policy using.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">If COB support monitor some specified process (VM process) and accept priority defined, it will be good to reuse.
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
<br>
<br>
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">At last the question came out:</span><o:p></o:p></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoNormal" style="mso-list:l2 level1 lfo8"><span style="font-size:11.0pt">Support a fine-grained llc cache control , let user specify cache allocation</span><o:p></o:p></li><li class="MsoNormal" style="mso-list:l2 level1 lfo8"><span style="font-size:11.0pt">Support pre-defined policies and user specify llc allocation priority.</span><o:p></o:p></li></ul>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Reference</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">[1] COB <a href="http://clrgitlab.intel.com/rdt/cob/tree/master">
http://clrgitlab.intel.com/rdt/cob/tree/master</a></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">[2] CAT intro: <a href="https://software.intel.com/en-us/articles/software-enabling-for-cache-allocation-technology">
https://software.intel.com/en-us/articles/software-enabling-for-cache-allocation-technology</a>
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">[3] kernel Intel_rdt_ui [ <a href="https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/tree/Documentation/x86/intel_rdt_ui.txt?h=x86/cache">
https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/tree/Documentation/x86/intel_rdt_ui.txt?h=x86/cache</a> ]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian;color:black">Best Regards</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian;color:black">Eli Qiao(<span lang="ZH-CN">乔立勇)</span>OpenStack Core team OTC Intel.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian;color:black">-- </span><o:p></o:p></p>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</body>
</html>