[Bug 55061] cpu stats reported in cgroup file is erroneous

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=55061





--- Comment #2 from Roopa Govind <roopagovind@xxxxxxxxx>  2013-03-26 17:24:51 ---
(In reply to comment #1)
> user_time and system_time reported by virsh are from the point of view of the
> domain on the host machine. Assuming it is QEMU, the stats reported are for the
> QEMU process which is created when VM is started.
> 

Agree, it is reported under cpuacct.usage file under the /<guest-name>/ cgroup.

> A while 1 loop inside VM would only change the vcpu_time and cpu_time.
> Therefore, user_time or system_time would not be modified at all. cgroups
> inside the VM is proper place to look for the stats you are looking for.

I beg to disagree here. I performed this test.

For my guest my 
1. # of vcpus = # of host cpus
2. Used cpu load generator (https://github.com/beloglazov/cpu-load-generator)
inside the guest to generate 90% load for 600 seconds.

#python cpu-load-generator.py -n 4 600 test.data

test.data has values 90 and 80 (for generating 90% and 80% load)

3. changed the cpu shares for my cgroup /<guest-name> to 4096 and to my rest of
the system to 200 using cgset

4. Now ran a sar utility on the host with following options

sar -u ALL 1 600 

and i could see that my %guest utilization percentage shot up to ~90% and ~80%
respectively and %idle was showing ~10% and ~20% while the cpu-load generator
was running inside the guest. 

As soon as the cpu-load-generator stopped the cpu utilization drastically
reduced to 95% idle and 5% utilization.

When I observed the cgroup cpuacct.usage file for my guest under /<guest-name>,
i found that user time < system time.


Now i repeated steps 1-4 with a twist. Before start of my cpu-load-generator in 
my guest, i cleared the cpuacct.usage file to 0 value using the cgset -r
cpuacct.usage=0 /<guest-name>

and reran the whole steps. Now I could find that my user time was drastically
improving compared to system time in cpuacct.usage file. So it does report it
correctly if I set the values to 0 before starting my test.

Let me know if you like to see some screenshots, i can provide you the same.

Thank You for looking into this.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux