All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@novell.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: changing vcpus on running domain
Date: Mon, 06 Oct 2008 13:35:54 -0600	[thread overview]
Message-ID: <48EA689A.7010501@novell.com> (raw)

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

                 reply	other threads:[~2008-10-06 19:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48EA689A.7010501@novell.com \
    --to=jfehlig@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.