[pve-devel] cpu hotplug need some rework

Alexandre DERUMIER aderumier at odiso.com
Thu Jan 8 08:53:12 CET 2015


Hi,

I just notice that something is wrong currently with cpu hotplug implementation,

and that maybe it'll break in coming qemu release according to this patch

http://lists.gnu.org/archive/html/qemu-devel/2014-11/msg01305.html

Start guiding users towards making sure their topology supports the
maximum number of cpus they wish to support. A future patch series
will enforce this for new machine types.

+        max_cpus = max_cpus ?: cpus;
+
+        if (sockets * cores * threads != max_cpus) {
+            fprintf(stderr, "cpu topology: warning: "
+                    "sockets (%u) * cores (%u) * threads (%u) != max_cpus 
(%u)\n",
+                    sockets, cores, threads, max_cpus);
+        }
 


Currently, we use "cores" to hotplug vcpus, but this is wrong.

sockets and cores options, should give us topology of hotpluggables cpus.


For example:

sockets:2
cores:2

and maybe a new option like

cpus:1-maxcpus

to enable hotplugged vcpus 

we should start with cpus=1,sockets=2,cores=2,maxcpus=4

(That give use 1vcpu running in guest with a prefined topology of 2sockets and 2 cores)

then, to hotpluged|unplug vcpus,

qm set -vcpus X



(maybe if hotplug=1, can we add to command line 
maxcpus=sockets*cores 
and 
cpus=sockets*cores if vcpus option is not defined 
)



But that mean that we need to remove the maxcpus option to current code,
So I don't known if users already use this feature (not exposed to gui)




 



More information about the pve-devel mailing list