Red Hat Bugzilla – Bug 499611
Hotplugging vcpus to an F-11 64-bit Xen domU doesn't work
Last modified: 2010-09-07 09:08:07 EDT
Description of problem:
Following the test case here:
I'm trying to plug and unplug virtual CPUs from an F-11 x86_64 Xen guest. I boot up the guest with 8 vcpus, and all 8 are shown in /proc/cpuinfo. Then, on the dom0, I issue:
# xm vcpu-set f11 2
Which unplugs 6 of the vcpus. Now only 2 cpus are shown in the guest. However, if I now do:
# xm vcpu-set f11 8
Nothing happens. What should happen is that we should hotplug 6 more vcpus into the guest, and now the guest should have the original 8 vcpus.
Another fairly important thing to get working in upstream and Fedora.
It needs some usermode support to work. It will generate uevents, and a script is needed to do the actual onlining. You can see that the cpus will appear and disappear in /sys/devices/system/cpu/present.
This is a behaviour change from older Xen kernels which did this internally, but seemed like the better approach.
So I suppose the question here would be where should such a script live? With the pv_ops domU kernel, there is no difference in a PV domU install and a bare metal.
Do you mean "which package" or "which filesystem"?
The idea is that this should be the same as a native system with hotplug physical cpus; you insert the CPU module, then a hotplug script actually onlines them. There's nothing Xen-specific about the script or what it does.
(Though I'm not certain that real cpu hotplug works like this.)
Right, so it appears that real hotplug can work like this just fine as well. The real question: is there any reason we should not make udev online cpus on an add? The arguments I have seen against this are power consumption related. Udev certainly gets events on the CPU add or removal, and making it online a CPU on add would be trivial. It has certainly changed from a mechanism question to a policy question.
The uevents / sysfs notication/online Jeremy mentions in comment #2, sounds like exactly the same thing Glauba came up against when trying todo KVM CPU hotplug. I can't remember whether he ended up using this or not, but it would make sense for us to have same CPU onlining process for KVM and Xen guests if practical.
kvm would work the same way. Essentially it is a udev rule. After thinking on it a bit, I believe the rule is necessary. I find it hard to believe that people who really care about power management would add a CPU to a running system without a desire to online that CPU. Most power management would be achieved by taking existing CPUs online or offline without attaching or removing them. The udev rule would only online a CPU when it is attached, meaning CPUs that you specifically offline but leave present would not change state.
Created attachment 344840 [details]
CPU online patch
Attached a patch which automatically onlines CPUs as they are added. Tested with several add and removes on F-11.
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.
More information and reason for this action is here:
Why does the kernel not bring the CPUs online? Aren't real CPUs brought online immediately?
Not sure to be honest, but there is no harm in onlining an already online cpu. And I suspect that virt users are far more likely to hotplug CPUs than bare metal.
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '11'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 11's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 11 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
should be fixed.. bug is in "MODIFIED"
Oops, sorry, I shot from the hip here when I bumped this up to f13. I forgot this bug was for host physical cpu hotplug, not guest vcpu hotplug. Resetting this to 11 to allow it to be CLOSED.
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.