Bug 840789 - The "CPU time" information has been lost except first section while use command "virsh vcpuinfo <guest>".
The "CPU time" information has been lost except first section while use comma...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
x86_64 Linux
medium Severity low
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-17 04:40 EDT by lei wang
Modified: 2012-07-19 10:36 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-19 10:36:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description lei wang 2012-07-17 04:40:57 EDT
Description of problem:
The "CPU time" information has been lost except first section while use command "virsh vcpuinfo <guest>".

Version-Release number of selected component (if applicable):
# rpm -qa |grep libvirt
libvirt-client-0.9.13-2.el6.x86_64
libvirt-0.9.13-2.el6.x86_64
libvirt-python-0.9.13-2.el6.x86_64
libvirt-docs-0.9.13-2.el6.x86_64
libvirt-daemon-0.9.13-2.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1, Install a new vm in a numa box. In the xml description of the vm, we could specify the physical cpuset using "cpuset"attribute of vcpu element. xml as follows:

...
  <vcpu cpuset='0'>3</vcpu>
...

2, then, output the vcpu information on the vm, we can see that all of the vcpu are pinned into the first physical cpu.

# virsh vcpuinfo migratetest

  
Actual results:
The "CPU time" information has been lost except first section.

# virsh vcpuinfo rhel6u3
VCPU:           0
CPU:            0
State:          running
CPU time:       0.7s
CPU Affinity:   y---------------------------------------------------------------------------------------------------------------------------------------------------------------

VCPU:           1
CPU:            0
State:          running
CPU Affinity:   y---------------------------------------------------------------------------------------------------------------------------------------------------------------

VCPU:           2
CPU:            0
State:          running
CPU Affinity:   y---------------------------------------------------------------------------------------------------------------------------------------------------------------


Expected results:
The "CpPU time" could display on every section
# virsh vcpuinfo migratetest
VCPU:           0
CPU:            0
State:          running
CPU time:       85.7s
CPU Affinity:   y-

VCPU:           1
CPU:            0
State:          running
CPU time:       111.0s
CPU Affinity:   y-

VCPU:           2
CPU:            0
State:          running
CPU time:       109.8s
CPU Affinity:   y-

Additional info:
This issue is not reproduce on build libvirt-0.9.10-21.el6_3.1.x86_64.
# rpm -qa |grep libvirt
libvirt-client-0.9.10-21.el6_3.1.x86_64
libvirt-0.9.10-21.el6_3.1.x86_64
libvirt-python-0.9.10-21.el6_3.1.x86_64
# virsh edit rhel6
Domain rhel6 XML configuration not changed.

# virsh list
 Id    Name                           State
----------------------------------------------------
 2     rhel6                          running

# virsh vcpuinfo rhel6
VCPU:           0
CPU:            0
State:          running
CPU time:       15.9s
CPU Affinity:   y-------

VCPU:           1
CPU:            0
State:          running
CPU time:       10.4s
CPU Affinity:   y-------

VCPU:           2
CPU:            0
State:          running
CPU time:       10.5s
CPU Affinity:   y-------
Comment 2 Peter Krempa 2012-07-17 11:52:01 EDT
Does this bug reproduce if you leave the machine running for a while (until the guest fully starts up)?

From the output you provided, it looks like the machine was just started (CPU 0 consumed 0.7s cpu time) and the guest OS wasn't able to start the extra processors you assigned to it. This results then in not showing the CPU time: line as the processors didn't consume any time.
Comment 3 Peter Krempa 2012-07-17 11:57:45 EDT
Output from a quick test on my machine that supports the hypothesis:

virsh # start win7
Domain win7 started

virsh # vcpuinfo win7
VCPU:           0
CPU:            0
State:          running
CPU time:       4.0s
CPU Affinity:   y---

VCPU:           1
CPU:            0
State:          running
CPU Affinity:   y---

virsh # vcpuinfo win7
VCPU:           0
CPU:            0
State:          running
CPU time:       5.9s
CPU Affinity:   y---

VCPU:           1
CPU:            0
State:          running
CPU Affinity:   y---

virsh # vcpuinfo win7
VCPU:           0
CPU:            0
State:          running
CPU time:       7.5s
CPU Affinity:   y---

VCPU:           1
CPU:            0
State:          running
CPU time:       0.2s
CPU Affinity:   y---

virsh # vcpuinfo win7
VCPU:           0
CPU:            0
State:          running
CPU time:       8.0s
CPU Affinity:   y---

VCPU:           1
CPU:            0
State:          running
CPU time:       0.7s
CPU Affinity:   y---
Comment 4 lei wang 2012-07-17 22:15:39 EDT
(In reply to comment #2)
> Does this bug reproduce if you leave the machine running for a while (until
> the guest fully starts up)?
> 
> From the output you provided, it looks like the machine was just started
> (CPU 0 consumed 0.7s cpu time) and the guest OS wasn't able to start the
> extra processors you assigned to it. This results then in not showing the
> CPU time: line as the processors didn't consume any time.

Hi Peter, you are right, I check this issue again in my test environment, the other cpu is not running before service starting, the cpu will be running once service starting.

[root@localhost ~]# virsh vcpuinfo rhel6q
VCPU:           0
CPU:            0
State:          running
CPU time:       6.0s
CPU Affinity:   y-------

VCPU:           1
CPU:            0
State:          running
CPU Affinity:   y-------

[root@localhost ~]# virsh vcpuinfo rhel6q
VCPU:           0
CPU:            0
State:          running
CPU time:       6.3s
CPU Affinity:   y-------

VCPU:           1
CPU:            0
State:          running
CPU time:       0.2s
CPU Affinity:   y-------
Comment 5 Peter Krempa 2012-07-19 10:36:14 EDT
Hi Lei,
I'm going to close this as NOTABUG. Please reopen this bug if any of your test machines would show up the same symptoms after the guest OS started all the allocated virtual processors.

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