* changing vcpus on running domain
@ 2008-10-06 19:35 Jim Fehlig
0 siblings, 0 replies; only message in thread
From: Jim Fehlig @ 2008-10-06 19:35 UTC (permalink / raw)
To: xen-devel
Hi All,
xen-3.3-testing c/s 18434
I'm hoping someone can help me understand the behavior of changing
number of vcpus (e.g. "xm vcpu-set dom #") on a running domain. I'm
quite confused by the code in tools/python/xen/xend/XendDomainInfo.py
def setVCpuCount(self, vcpus):
if vcpus <= 0:
raise XendError('Invalid VCPUs')
The following bitmap will be problematic with Jan's work to increase
number of cpus supported but thats a different issue :-)
self.info['vcpu_avail'] = (1 << vcpus) - 1
if self.domid >= 0:
self.storeVm('vcpu_avail', self.info['vcpu_avail'])
# update dom differently depending on whether we are adjusting
# vcpu number up or down, otherwise _vcpuDomDetails does not
# disable the vcpus
if self.info['VCPUs_max'] > vcpus:
# decreasing
self._writeDom(self._vcpuDomDetails())
self.info['VCPUs_live'] = vcpus
else:
# same or increasing
self.info['VCPUs_live'] = vcpus
self._writeDom(self._vcpuDomDetails())
...
I'm not sure what the difference is between these two conditions?
VCPUS_live is not used anywhere, so essentially you get the same
behavior regardless of the condition. Further, according to comments
regarding VCPUs_max in XendConfig.py, increasing vcpus > VCPUs_max
should not be allowed. Should the else simply be a failure?
I see strange results when attempting to decrease the number of vcpus
jjfehlig4:~ # xm li
Name ID Mem VCPUs State
Time(s)
Domain-0 0 1481 4 r-----
372.2
test-pv 7 512 4
r----- 2.0
fehlig4:~ # xm li -l test-pv | grep -i cpu
(vcpus 4)
(cpu_time 14.310619269)
(online_vcpus 4)
OK, looks good. Now decrease vcpus
jfehlig4:~ # xm vcpu-set test-pv 2
jfehlig4:~ # xm li
Name ID Mem VCPUs State
Time(s)
Domain-0 0 1481 4 r-----
372.7
test-pv 7 512 3
-b---- 5.7
fehlig4:~ # xm li -l test-pv | grep -i cpu
(vcpus 4)
(cpu_time 14.689999154)
(online_vcpus 3)
Strange, why 3 vcpus when I decreased to 2? BTW, this is always the
case - decrease vcpus to n and online_vcpus = n+1.
I'll continue digging but any insight as to how this code should work
would be appreciated :-).
Thanks,
Jim
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-10-06 19:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-06 19:35 changing vcpus on running domain Jim Fehlig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.