<html xmlns:v="urn:schemas-microsoft-com:vml" 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="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:LibvirtOverpass;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:宋体;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:宋体;
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:宋体;
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="ZH-CN" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">For your question, I would suggest to use the second form, this is consistent with qemu, and will not bring platform specific knowledge to libvirt layer:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">2. or we let user specify the host-nodes.<br>
  <memoryBacking><br>
    <mcdram nodeset="3-4", host-nodes="0-1"/><br>
  </memoryBacking><br>
</domain></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span lang="EN-US"><o:p> </o:p></span></a></p>
<p class="MsoNormal"><span lang="EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dolpher<o:p></o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">
 Feng, Shaohe <br>
<b>Sent:</b> Monday, December 26, 2016 7:58 PM<br>
<b>To:</b> Daniel P. Berrange <berrange@redhat.com><br>
<b>Cc:</b> Du, Dolpher <dolpher.du@intel.com>; He Chen <he.chen@linux.intel.com>; libvir-list@redhat.com; Zyskowski, Robert <robert.zyskowski@intel.com>; Daniluk, Lukasz <lukasz.daniluk@intel.com>; Zang, Rui <rui.zang@intel.com>; jdenemar@redhat.com<br>
<b>Subject:</b> Re: [libvirt] [RFC] phi support in libvirt<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal">Thanks<span lang="EN-US">, Daniel.  <br>
<br>
So </span>how<span lang="EN-US"> about: <br>
<br>
for the </span><span lang="EN-US" style="font-size:13.5pt;font-family:"LibvirtOverpass",serif;background:white">NUMA format,
</span><span lang="EN-US"><br>
we still uses "memory" to describe the mcdram. <br>
But we remove the cpus elements.<br>
<numa><br>
  <cell id='3' memory='8' unit='GiB'/> </numa><br>
  <cell id='4' memory='8' unit='GiB'/> </numa><br>
<br>
At present, for this kind CPUless </span><span lang="EN-US" style="font-size:13.5pt;font-family:"LibvirtOverpass",serif">NUMA
</span><span lang="EN-US">,  we only support mcdram as memroy backend.<br>
<br>
<domain><br>
  ...<br>
  <memoryBacking><br>
    <mcdram nodeset="3-4"/><br>
  </memoryBacking><br>
</domain> <br>
<br>
And we reject a CPUless </span><span lang="EN-US" style="font-size:13.5pt;font-family:"LibvirtOverpass",serif">NUMA without
</span><span lang="EN-US">memroy backend. <br>
Maybe we will allow it in futures after qemu can handle it well.<br>
<br>
<br>
A question: <br>
1. Should libvirt probe the "host-nodes" for this kind of memory to make a smart map?
<br>
<br>
The qemu arguments will be as follow:<br>
-object memory-backend-ram,size=8G,prealloc=yes,host-nodes=0,policy=bind,id=node3 \<br>
-numa node,nodeid=3,memdev=node3 \<br>
<br>
-object memory-backend-ram,size=8G,prealloc=yes,host-nodes=0,policy=bind,id=node4 \<br>
-numa node,nodeid=4,memdev=node4 \<br>
<br>
<br>
2. or we let user specify the host-nodes.<br>
  <memoryBacking><br>
    <mcdram nodeset="3-4", host-nodes="0-1"/><br>
  </memoryBacking><br>
</domain> <br>
<br>
<br>
BR<br>
ShaoHe Feng<br>
<br>
On 2016</span>年<span lang="EN-US">12</span>月<span lang="EN-US">21</span>日<span lang="EN-US"> 18:25, Daniel P. Berrange wrote:<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">On Wed, Dec 21, 2016 at 12:51:29PM +0800, Feng, Shaohe wrote:<o:p></o:p></span></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">Thanks.  Dolpher.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">Reply inline.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">On 2016</span>年<span lang="EN-US">12</span>月<span lang="EN-US">21</span>日<span lang="EN-US"> 11:56, Du, Dolpher wrote:<o:p></o:p></span></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">Shaohe was dropped from the loop, adding him back.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">-----Original Message-----<o:p></o:p></span></pre>
<pre><span lang="EN-US">From: He Chen [<a href="mailto:he.chen@linux.intel.com">mailto:he.chen@linux.intel.com</a>]<o:p></o:p></span></pre>
<pre><span lang="EN-US">Sent: Friday, December 9, 2016 3:46 PM<o:p></o:p></span></pre>
<pre><span lang="EN-US">To: Daniel P. Berrange <a href="mailto:berrange@redhat.com"><berrange@redhat.com></a><o:p></o:p></span></pre>
<pre><span lang="EN-US">Cc: <a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a>; Du, Dolpher <a href="mailto:dolpher.du@intel.com"><dolpher.du@intel.com></a>; Zyskowski,<o:p></o:p></span></pre>
<pre><span lang="EN-US">Robert <a href="mailto:robert.zyskowski@intel.com"><robert.zyskowski@intel.com></a>; Daniluk, Lukasz<o:p></o:p></span></pre>
<pre><span lang="EN-US"><a href="mailto:lukasz.daniluk@intel.com"><lukasz.daniluk@intel.com></a>; Zang, Rui <a href="mailto:rui.zang@intel.com"><rui.zang@intel.com></a>;<o:p></o:p></span></pre>
<pre><span lang="EN-US"><a href="mailto:jdenemar@redhat.com">jdenemar@redhat.com</a><o:p></o:p></span></pre>
<pre><span lang="EN-US">Subject: Re: [libvirt] [RFC] phi support in libvirt<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">On Mon, Dec 05, 2016 at 04:12:22PM +0000, Feng, Shaohe wrote:<o:p></o:p></span></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">Hi all:<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">As we are know Intel® Xeon phi targets high-performance computing and<o:p></o:p></span></pre>
<pre><span lang="EN-US">other parallel workloads.<o:p></o:p></span></pre>
<pre><span lang="EN-US">Now qemu has supported phi virtualization</span>,<span lang="EN-US">it is time for libvirt to<o:p></o:p></span></pre>
<pre><span lang="EN-US">support phi.<o:p></o:p></span></pre>
</blockquote>
<pre><span lang="EN-US">Can you provide pointer to the relevant QEMU changes.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
</blockquote>
<pre><span lang="EN-US">Xeon Phi Knights Landing (KNL) contains 2 primary hardware features, one<o:p></o:p></span></pre>
<pre><span lang="EN-US">is up to 288 CPUs which needs patches to support and we are pushing it,<o:p></o:p></span></pre>
<pre><span lang="EN-US">the other is Multi-Channel DRAM (MCDRAM) which does not need any changes<o:p></o:p></span></pre>
<pre><span lang="EN-US">currently.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">Let me introduce more about MCDRAM, MCDRAM is on-package<o:p></o:p></span></pre>
<pre><span lang="EN-US">high-bandwidth<o:p></o:p></span></pre>
<pre><span lang="EN-US">memory (~500GB/s).<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">On KNL platform, hardware expose MCDRAM as a seperate, CPUless and<o:p></o:p></span></pre>
<pre><span lang="EN-US">remote NUMA node to OS so that MCDRAM will not be allocated by default<o:p></o:p></span></pre>
<pre><span lang="EN-US">(since MCDRAM node has no CPU, every CPU regards MCDRAM node as<o:p></o:p></span></pre>
<pre><span lang="EN-US">remote<o:p></o:p></span></pre>
<pre><span lang="EN-US">node). In this way, MCDRAM can be reserved for certain specific<o:p></o:p></span></pre>
<pre><span lang="EN-US">applications.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">Different from the traditional X86 server, There is a special numa<o:p></o:p></span></pre>
<pre><span lang="EN-US">node with Multi-Channel DRAM (MCDRAM) on Phi, but without any CPU .<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">Now libvirt requires nonempty cpus argument for NUMA node, such as.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><numa><o:p></o:p></span></pre>
<pre><span lang="EN-US">   <cell id='0' cpus='0-239' memory='80' unit='GiB'/><o:p></o:p></span></pre>
<pre><span lang="EN-US">   <cell id='1' cpus='240-243' memory='16' unit='GiB'/> </numa><o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">In order to support phi virtualization, libvirt needs to allow a numa<o:p></o:p></span></pre>
<pre><span lang="EN-US">cell definition without 'cpu' attribution.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">Such as:<o:p></o:p></span></pre>
<pre><span lang="EN-US"><numa><o:p></o:p></span></pre>
<pre><span lang="EN-US">   <cell id='0' cpus='0-239' memory='80' unit='GiB'/><o:p></o:p></span></pre>
<pre><span lang="EN-US">   <cell id='1' memory='16' unit='GiB'/> </numa><o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">When a cell without 'cpu', qemu will allocate memory by default MCDRAM<o:p></o:p></span></pre>
</blockquote>
</blockquote>
<pre><span lang="EN-US">instead of DDR.<o:p></o:p></span></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">There's separate concepts at play which your description here is mixing up.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">First is the question of whether the guest NUMA node can be created with<o:p></o:p></span></pre>
</blockquote>
<pre><span lang="EN-US">only RAM or CPUs, or a mix of both.<o:p></o:p></span></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="EN-US">Second is the question of what kind of host RAM (MCDRAM vs DDR) is used<o:p></o:p></span></pre>
</blockquote>
<pre><span lang="EN-US">as the backing store for the guest<o:p></o:p></span></pre>
<pre><span lang="EN-US">Guest NUMA node shoulde be created with memory only (keep the same as<o:p></o:p></span></pre>
<pre><span lang="EN-US">host's) and the more important things is the memory should bind to (come<o:p></o:p></span></pre>
<pre><span lang="EN-US">from) host MCDRAM node.<o:p></o:p></span></pre>
</blockquote>
</blockquote>
<pre><span lang="EN-US">So I suggest libvirt distinguish the MCDRAM<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">And the MCDRAM numa config as follow, add a "mcdram" attribute for "cell"<o:p></o:p></span></pre>
<pre><span lang="EN-US">element:<o:p></o:p></span></pre>
<pre><span lang="EN-US"><numa><o:p></o:p></span></pre>
<pre><span lang="EN-US">  <cell id='1'  mcdram='16' unit='GiB'/> </numa><o:p></o:p></span></pre>
<pre><span lang="EN-US">  <cell id='0' cpus='0-239' memory='80' unit='GiB'/><o:p></o:p></span></pre>
</blockquote>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">No, that is not backwards compatible for applications using libvirt.<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">We already have a place for storing info about memory backing type,<o:p></o:p></span></pre>
<pre><span lang="EN-US">which we use for huge pages. mcdram should use the same approach<o:p></o:p></span></pre>
<pre><span lang="EN-US">IMHO. eg<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US"><domain><o:p></o:p></span></pre>
<pre><span lang="EN-US">  ...<o:p></o:p></span></pre>
<pre><span lang="EN-US">  <memoryBacking><o:p></o:p></span></pre>
<pre><span lang="EN-US">    <mcdram nodeset="3-4"/><o:p></o:p></span></pre>
<pre><span lang="EN-US">  </memoryBacking><o:p></o:p></span></pre>
<pre><span lang="EN-US"></domain><o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">to indicate that nodes 3 & 4 should use mcdram<o:p></o:p></span></pre>
<pre><span lang="EN-US"><o:p> </o:p></span></pre>
<pre><span lang="EN-US">Regards,<o:p></o:p></span></pre>
<pre><span lang="EN-US">Daniel<o:p></o:p></span></pre>
</blockquote>
<p><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</div>
</body>
</html>