Bug 339481 - [5.2] "virsh vcpupin" cannot allocate cpu at a time to all VCPUs in the domain.
[5.2] "virsh vcpupin" cannot allocate cpu at a time to all VCPUs in the domain.
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Veillard
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2007-10-19 07:07 EDT by Nobuhiro Itou
Modified: 2009-12-14 16:23 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-12-18 05:57:42 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Nobuhiro Itou 2007-10-19 07:07:50 EDT
Description of problem:
"virsh vcpupin" cannot allocate cpu at a time to all VCPUs in the domain.
When I allocate all same physical CPU number to all VCPUs,
I have to execute the command to virtual CPU one by one.

But, "xm vcpu-pin" can use the keyword "all" to <vcpu> operand, 
and can allocate cpu at a time to all VCPUs in the domain.

Version-Release number of selected component (if applicable):
   installed from RPM (RHEL5.1 RC):
       kernel-xen: 2.6.18-52.el5
       xen: 3.0.3-41.el5
   got from cvs:
       libvirt: upstream(Revision of Changelog is 1.772)

How reproducible:

Steps to Reproduce:
1.Start the guest domain with the configuration file
  # cat /etc/xen/guest_dom
  name = "guest_dom"
  uuid = "29610f8f-e164-ea5a-a54a-2d909e8d9043"
  maxmem = 1024
  memory = 1024
  vcpus = 32
  cpu_weight = 512
  cpu_cap = 300
  bootloader = "/usr/bin/pygrub"
  on_poweroff = "destroy"
  on_reboot = "restart"
  on_crash = "restart"
  vnc = 1
  vncunused = 0
  vncdisplay = "25"
  disk = [ "phy:/dev/sda5,xvda,w" ]
  vif = [ "mac=02:17:42:2F:01:13,bridge=xenbr2" ]

  # virsh start guest_dom

2.Execute virsh vcpupin for all vcpus
  # virsh vcpupin guest_dom 0 0
  # virsh vcpupin guest_dom 1 0
  # virsh vcpupin guest_dom 2 0
  # virsh vcpupin guest_dom 3 0
  # virsh vcpupin guest_dom 31 0

Actual results:
"virsh vcpupin" cannot allocate cpu at a time to all VCPUs in the domain.

Expected results:
"virsh vcpupin" can allocate cpu at a time to all VCPUs in the domain.

Additional info:
Comment 1 Daniel Veillard 2007-10-19 11:43:42 EDT
  When would you actually use this. Having a vary large number of
vcpus and pinning them all to a single physical CPU sounds a really bad
idea performance wise, I'm not sure it is actually a good idea to add this
option. This sounds more thangerous than useful.
  Please suggest this extension on the mailing-list as it's a new feature
and please justify, because that sounds more dangerous than useful to me
right now,

Comment 2 RHEL Product and Program Management 2007-10-19 11:45:01 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 3 Nobuhiro Itou 2007-10-26 07:01:55 EDT
It is just an example that having too many vcpus and pining them to a single 
physical CPU. 
I think it will be useful to set the PCPU to all VCPU when each guest domain 
has several setting of vcpu affinites, 
because it is hard to work to change the several setting.
like the following case:
  Dom1 VCPU:0-3 PCPU:0-3
  Dom2 VCPU:0-3 PCPU:4-7
  Dom3 VCPU:0-3 PCPU:8-11
  Dom4 VCPU:0-9 PCPU:12-21

And this function is necessary to implement the following feature.
First, we implement allocate cpu at a time to all VCPUs in the active domain.
Next, we use the interface pinning all vcpus 
when starting by the information of CPU in domain configuration file.
Comment 4 Daniel Veillard 2007-10-26 10:21:37 EDT
for 251641 I don't think it makes sense to add vcpu pinning to XML configuration.
And I also don't see how this relates to the current bugzilla.
I don't think the way you want to extend virsh to be very practical.
I don't think adding a bunch of special cases will be a good approach
('all' is a special case).
Please look instead to my suggested tuning extension to virsh
I don't think that tricks like 'all' will really help the user much
I think designing the proper virsh functionalities for saving and loading
tuning information will be far more useful, generic and versatile.

Comment 5 Nobuhiro Itou 2007-12-05 20:39:21 EST
I agree to your opinion. 

I withdraw this ticket. 
Please close this. 

Comment 6 Daniel Veillard 2007-12-18 05:57:42 EST
Thanks, closed accordingly !


Note You need to log in before you can comment on or make changes to this bug.