On 07/29/2018 11:12 PM, bing.niu@xxxxxxxxx wrote: > From: Bing Niu <bing.niu@xxxxxxxxx> > > Introduce a new section memorytune to support memory bandwidth allocation. > This is consistent with existing cachetune. As the example: > below: > <cputune> > ...... > <memorytune vcpus='0'> > <node id='0' bandwidth='30'/> > </memorytune> > </cputune> > > vpus --- vpus subjected to this memory bandwidth. > id --- on which node memory bandwidth to be set. > bandwidth --- the memory bandwidth percent to set. > > Signed-off-by: Bing Niu <bing.niu@xxxxxxxxx> > --- > docs/formatdomain.html.in | 39 +++- > docs/schemas/domaincommon.rng | 17 ++ > src/conf/domain_conf.c | 200 +++++++++++++++++++++ > .../memorytune-colliding-allocs.xml | 30 ++++ > .../memorytune-colliding-cachetune.xml | 32 ++++ > tests/genericxml2xmlindata/memorytune.xml | 33 ++++ > tests/genericxml2xmltest.c | 5 + > 7 files changed, 355 insertions(+), 1 deletion(-) > create mode 100644 tests/genericxml2xmlindata/memorytune-colliding-allocs.xml > create mode 100644 tests/genericxml2xmlindata/memorytune-colliding-cachetune.xml > create mode 100644 tests/genericxml2xmlindata/memorytune.xml > > diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in > index 19b7312..1ae6e98 100644 > --- a/docs/formatdomain.html.in > +++ b/docs/formatdomain.html.in > @@ -759,6 +759,10 @@ > <cache id='0' level='3' type='both' size='3' unit='MiB'/> > <cache id='1' level='3' type='both' size='3' unit='MiB'/> > </cachetune> > + <memorytune vcpus='0-3'> > + <node id='0' bandwidth='60'/> > + </memorytune> > + > </cputune> > ... > </domain> > @@ -932,7 +936,9 @@ > size and required granularity are reported as well. The required > attribute <code>vcpus</code> specifies to which vCPUs this allocation > applies. A vCPU can only be member of one <code>cachetune</code> element > - allocations. Supported subelements are: > + allocations. The vCPUs specified by cachetune can be identical with those s/allocations/allocation (since we're touching the line anyway) > + in memorytune, however they are not allowed to overlap. > + Supported subelements are: > <dl> > <dt><code>cache</code></dt> > <dd> > @@ -972,7 +978,38 @@ > </dl> > </dd> > </dl> > + </dd> > > + <dt><code>memorytune</code><span class="since">Since 4.7.0</span></dt> > + <dd> > + Optional <code>memorytune</code> element can control allocations for > + memory bandwidth using the resctrl on the host. Whether or not is this > + supported can be gathered from capabilities where some limitations like > + minimum bandwidth and required granularity are reported as well. The > + required attribute <code>vcpus</code> specifies to which vCPUs this > + allocation applies. A vCPU can only be member of one > + <code>memorytune</code> element allocations. The <code>vcpus</code> specified s/allocations/allocation/ > + by <code>memorytune</code> can be identical to those specified by > + <code>cachetune</code>. However they are not allowed to overlap each other. > + Supported subelements are: > + <dl> > + <dt><code>node</code></dt> > + <dd> > + This element controls the allocation of CPU memory bandwidth and has the > + following attributes: > + <dl> > + <dt><code>id</code></dt> > + <dd> > + Host node id from which to allocate memory bandwidth. > + </dd> > + <dt><code>bandwidth</code></dt> > + <dd> > + The memory bandwidth to allocate from this node. The value by default > + is in percentage. > + </dd> > + </dl> > + </dd> > + </dl> > </dd> > </dl> > [...] I'll fix in my branch before pushing John -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list