On Thu, Mar 08, 2012 at 09:36:26PM +0800, Osier Yang wrote:
numad is an user-level daemon that monitors NUMA topology and
processes resource consumption to facilitate good NUMA resource
alignment of applications/virtual machines to improve performance
and minimize cost of remote memory latencies. It provides a
pre-placement advisory interface, so significant processes can
be pre-bound to nodes with sufficient available resources.
More details:
http://fedoraproject.org/wiki/Features/numad
"numad -w ncpus:memory_amount" is the advisory interface numad
provides currently.
This patch add the support by introducing a new XML attribute
for <vcpu>. e.g.
<vcpu placement="auto">4</vcpu>
<vcpu placement="static" cpuset="1-10^6">4</vcpu>
The returned advisory nodeset from numad will be printed
in domain's dumped XML. e.g.
<vcpu placement="auto" cpuset="1-10^6">4</vcpu>
If placement is "auto", the number of vcpus and the current
memory amount specified in domain XML will be used for numad
command line (numad uses MB for memory amount):
numad -w $num_of_vcpus:$current_memory_amount / 1024
The advisory nodeset returned from numad will be used to set
domain process CPU affinity then. (e.g. qemuProcessInitCpuAffinity).
If the user specifies both CPU affinity policy (e.g.
(<vcpu cpuset="1-10,^7,^8">4</vcpu>) and placement ==
"auto"
the specified CPU affinity will be overridden.
Only QEMU/KVM drivers support it now.
See docs update in patch for more details.
v2 - v3:
* XML schema is changed to <vcpu
placement="static|auto">4</vcpu>
* Affected tests are updated
* LXC driver's support is dropped, let's see what's the real
performance on qemu driver first.
v1 - v2:
* Since Bill Gray says it doesn't matter to use the number of
vcpus and current memory amount as numad cmd line argument,
though from sementics point of view, what numad expects are
physical CPU numbers, let's go this way.
v2 dropped XML <cpu required_cpu='4'
required_memory='512000'/>,
and just a new boolean XML element <autonuma>. Codes are refactored
accordingly.
* v1 overrides the cpuset specified by <vcpu
cpuset='1-10,^7'>2</vcpu>,
v2 doesn't do that, but just silently ignored.
* xml2xml test is added
A relatively long patch, but I went through it and it looks okay, ACK
from me but I would appreciate someone else to have a quick look :-)
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/