[libvirt] [PATCH 2/5] docs: Define XML schema for numa tuning and add docs

Osier Yang jyang at redhat.com
Thu May 5 09:38:27 UTC 2011


Currently we only want to use "membind" function of numactl, but
perhaps more other functions in future, so introduce element
"<numatune>", future NUMA tuning related XML stuffs should go
into it.
---
 docs/formatdomain.html.in |   17 +++++++++++++++++
 docs/schemas/domain.rng   |   20 ++++++++++++++++++++
 2 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 5013c48..6da6465 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -288,6 +288,9 @@
     <min_guarantee>65536</min_guarantee>
   </memtune>
   <vcpu cpuset="1-4,^3,6" current="1">2</vcpu>
+  <numatune>
+  <membind nodeset="1,2,!3-6">
+  </numatune>
   ...</pre>
 
     <dl>
@@ -366,6 +369,20 @@
         the OS provided defaults. NB, There is no unit for the value, it's a relative
         measure based on the setting of other VM, e.g. A VM configured with value
         2048 will get twice as much CPU time as a VM configured with value 1024.</dd>
+      <dt><code>numatune</code></dt>
+      <dd> The optional <code>numatune</code> element provides details of
+        how to tune the performance of a NUMA host via controlling NUMA policy for
+        domain process.
+      <dt><code>membind</code></dt>
+      <dd> The optional <code>membind</code> element specify how to allocate memory
+        for the domain process on a NUMA host. It contains attribute <code>nodeset</code>
+        , which specifies the NUMA nodes, the memory of domain process will only be
+        allocated from the specified nodes. <code>nodeset</code> can be specified as
+        N,N,N or N-N or N,N-N or N-N,N-N and so forth. Relative nodes may be specifed
+        as +N,N,N or +N-N or +N,N-N and so forth. The + indicates that the node numbers
+        are relative to the process' set of allowed nodes in its  current  cpuset. A
+        !N-N notation indicates the inverse of N-N, in other words all nodes except N-N.
+        If used with + notation, specify !+N-N.</dd>
     </dl>
 
     <h3><a name="elementsCPU">CPU model and topology</a></h3>
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 7163c6e..811f5ed 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -387,6 +387,21 @@
           </zeroOrMore>
         </element>
       </optional>
+
+      <!-- All the NUMA related tunables would go in the numatune -->
+      <optional>
+        <element name="numatune">
+          <optional>
+            <!-- Only allocate memory from specified NUMA nodes. -->
+            <element name="membind">
+              <attribute name="nodeset">
+                <ref name="nodeset"/>
+              </attribute>
+            </element>
+          </optional>
+        </element>
+      </optional>
+
     </interleave>
   </define>
   <define name="clock">
@@ -2265,6 +2280,11 @@
       <param name="pattern">([0-9]+(-[0-9]+)?|\^[0-9]+)(,([0-9]+(-[0-9]+)?|\^[0-9]+))*</param>
     </data>
   </define>
+  <define name="nodeset">
+    <data type="string">
+      <param name="pattern">([!\+]?[0-9]+(-[0-9]+)?)(,([!\+]?[0-9]+(-[0-9]+)?))*</param>
+    </data>
+  </define>
   <define name="countCPU">
     <data type="unsignedShort">
       <param name="pattern">[0-9]+</param>
-- 
1.7.4




More information about the libvir-list mailing list