mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-08 22:39:56 +00:00
f108944ae0
These 3 elements conflicts with each other in either the doc or the underlying codes. Current problems: Problem 1: The doc shouldn't simply say "These settings are superseded by CPU tuning. " for element <vcpu>. As except the tuning, <vcpu> allows to specify the current, maxmum vcpu number. Apart from that, <vcpu> also allows to specify the placement as "auto", which binds the domain process to the advisory nodeset from numad. Problem 2: Doc for <vcpu> says its "cpuset" specify the physical CPUs that the vcpus can be pinned. But it's not the truth, as actually it only pin domain process to the specified physical CPUs. So either it's a document bug, or code bug. Problem 3: Doc for <vcpupin> says it supersed "cpuset" of <vcpu>, it's not quite correct, as each <vcpupin> specify the pinning policy only for one vcpu. How about the ones which doesn't have <vcpupin> specified? it says the vcpu will be pinned to all available physical CPUs, but what's the meaning of attribute "cpuset" of <vcpu> then? Problem 4: Doc for <emulatorpin> says it pin the emulator threads (domain process in other context, perhaps another follow up patch to cleanup the inconsistency is needed) to the physical CPUs specified its attribute "cpuset". Which conflicts with <vcpu>'s "cpuset". And actually in the underlying codes, it set the affinity for domain process twice if both "cpuset" for <vcpu> and <emulatorpin> are specified, and <emulatorpin>'s pinning will override <vcpu>'s. Problem 5: When "placement" of <vcpu> is "auto" (I.e. uses numad to get the advisory nodeset to which the domain process is pinned to), it will also be overridden by <emulatorpin>, This patch is trying to sort out the conflicts or bugs by: 1) Don't say <vcpu> is superseded by <cputune> 2) Keep the semanteme for "cpuset" of <vcpu> (I.e. Still says it specify the physical CPUs the virtual CPUs). But modifying it to mention it also set the pinning policy for domain process, and the CPU placement of domain process specified by "cpuset" of <vcpu> will be ingored if <emulatorpin> specified, and similary, the CPU placement of vcpu thread will be ignored if it has <vcpupin> specified, for vcpu which doesn't have <vcpupin> specified, it inherits "cpuset" of <vcpu>. 3) Don't say <vcpu> is supersed by <vcpupin>. If neither <vcpupin> nor "cpuset" of <vcpu> is specified, the vcpu will be pinned to all available pCPUs. 4) If neither <emulatorpin> nor "cpuset" of <vcpu> is specified, the domain process (emulator threads in the context) will be pinned to all available pCPUs. 5) If "placement" of <vcpu> is "auto", <emulatorpin> is not allowed. 6) hotplugged vcpus will also inherit "cpuset" of <vcpu> Codes changes according to above document changes: 1) Inherit def->cpumask for each vcpu which doesn't have <vcpupin> specified, during parsing. 2) ping the vcpu which doesn't have <vcpupin> specified to def->cpumask either by cgroup for sched_setaffinity(2), which is actually done by 1). 3) Error out if "placement" == "auto", and <emulatorpin> is specified. Otherwise, <emulatorpin> is honored, and "cpuset" of <cpuset> is ignored. 4) Setup cgroup for each hotplugged vcpu, and setup the pinning policy by either cgroup or sched_setaffinity(2). 5) Remove cgroup and <vcpupin> for each hot unplugged vcpu. Patches are following (6 in total except this patch) |
||
---|---|---|
.. | ||
api_extension | ||
devhelp | ||
html | ||
internals | ||
schemas | ||
32favicon.png | ||
404.html.in | ||
api_extension.html.in | ||
api.html.in | ||
apibuild.py | ||
apps.html.in | ||
archdomain.html.in | ||
architecture.fig | ||
architecture.gif | ||
architecture.html.in | ||
archnetwork.html.in | ||
archnode.html.in | ||
archstorage.html.in | ||
auth.html.in | ||
bindings.html.in | ||
bugs.html.in | ||
compiling.html.in | ||
contact.html.in | ||
csharp.html.in | ||
deployment.html.in | ||
devguide.html.in | ||
docs.html.in | ||
downloads.html.in | ||
drivers.html.in | ||
drvesx.html.in | ||
drvhyperv.html.in | ||
drvlxc.html.in | ||
drvopenvz.html.in | ||
drvparallels.html.in | ||
drvphyp.html.in | ||
drvqemu.html.in | ||
drvremote.html.in | ||
drvtest.html.in | ||
drvuml.html.in | ||
drvvbox.html.in | ||
drvvmware.html.in | ||
drvxen.html.in | ||
errors.html.in | ||
et.png | ||
firewall.html.in | ||
footer_corner.png | ||
footer_pattern.png | ||
format.html.in | ||
formatcaps.html.in | ||
formatdomain.html.in | ||
formatnetwork.html.in | ||
formatnode.html.in | ||
formatnwfilter.html.in | ||
formatsecret.html.in | ||
formatsnapshot.html.in | ||
formatstorage.html.in | ||
formatstorageencryption.html.in | ||
generic.css | ||
goals.html.in | ||
hacking1.xsl | ||
hacking2.xsl | ||
hacking.html.in | ||
hooks.html.in | ||
hvsupport.pl | ||
index.html.in | ||
index.py | ||
internals.html.in | ||
intro.html.in | ||
java.html.in | ||
library.xen | ||
libvirt-daemon-arch.fig | ||
libvirt-daemon-arch.png | ||
libvirt-driver-arch.fig | ||
libvirt-driver-arch.png | ||
libvirt-header-bg.png | ||
libvirt-header-logo.png | ||
libvirt-net-logical.fig | ||
libvirt-net-logical.png | ||
libvirt-net-physical.fig | ||
libvirt-net-physical.png | ||
libvirt-object-model.fig | ||
libvirt-object-model.png | ||
libvirt.css | ||
libvirtLogo404.png | ||
libvirtLogo.png | ||
locking.html.in | ||
logging.html.in | ||
madeWith.png | ||
main.css | ||
Makefile.am | ||
migration-managed-direct.fig | ||
migration-managed-direct.png | ||
migration-managed-p2p.fig | ||
migration-managed-p2p.png | ||
migration-native.fig | ||
migration-native.png | ||
migration-tunnel.fig | ||
migration-tunnel.png | ||
migration-unmanaged-direct.fig | ||
migration-unmanaged-direct.png | ||
migration.html.in | ||
newapi.xsl | ||
news.html.in | ||
news.xsl | ||
node.fig | ||
node.gif | ||
page.xsl | ||
pending.html.in | ||
php.html.in | ||
python.html.in | ||
relatedlinks.html.in | ||
remote.html.in | ||
search.php.code.in | ||
search.php.in | ||
site.xsl | ||
sitemap.html.in | ||
storage.html.in | ||
structures.fig | ||
subsite.xsl | ||
testapi.html.in | ||
testsuites.html.in | ||
testtck.html.in | ||
todo.cfg-example | ||
todo.pl | ||
uri.html.in | ||
virshcmdref.html.in | ||
windows.html.in | ||
wrapstring.xsl |