WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] changing vcpus on running domain

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] changing vcpus on running domain
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Mon, 06 Oct 2008 13:35:54 -0600
Delivery-date: Mon, 06 Oct 2008 12:36:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.8 (X11/20060911)
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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] changing vcpus on running domain, Jim Fehlig <=