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

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



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 hotmail com

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