[virt-tools-list] Attribute vm load to individual physical cpu

Fury kerry furykerry at gmail.com
Fri Dec 9 11:24:07 UTC 2011


Hi list,

I'm trying to figure out a way to attribute the VM CPU% into individual
physical CPU or at least find out whether it is possible. Based on the FAQ
of virt-top ( http://people.redhat.com/~rjones/virt-top/faq.html#pcpu ) ,
it seems currently libvirt don't support it.

For KVM, attributing VM load into individual physical CPU equals to account
the task cpu times spent at each CPU.  Linux kernel export some scheduling
statistics  in /proc/<pid>/schedstat and /proc/schedstat, but I can not
find a way to derive or calculate the per CPU task time from there. Do you
guys know how to calculate or *approximate* per CPU task time, ( possiblly
from existing kernel statistics ), can you give me some directions? Or the
task itself e.g. KVM has to maintain such statistics.

Per the FAQ of virt-top,  there are only 2 workaround:

   1. Pin all your virtual CPUs to physical CPUs. Then there is no
   ambiguity.
   2. Assume that CPU affinity works and assume the domain is running on
   the '#'-marked CPU(s).

Workaround #2 seems promising but I'm not sure how accurate it is.
-- 
Please consider the environment before you print this mail
Zhen Zhang
Zhejiang University
Yuquan Campus
MSN:Fury_robert at hotmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20111209/17fe4164/attachment.htm>


More information about the virt-tools-list mailing list