[PATCH] PPC64 collect and export low-level cpu usage statistics

Manish Ahuja ahuja at austin.ibm.com
Sat Feb 11 07:45:08 EST 2006


I have made some changes to the patch. I will drop another patch at a 
later date with enhancements
and some modifications. At this point, I would like to resubmit this for 
review and forward if there are
no further comments.

Thanks,
Manish Ahuja
--------------------------------------------------------------------

The issue of correctness of time is an important one, where users
would like to accurately get a feel for how the system is performing.
With Virtualization and addition of abstract layers between the hardware
and the OS, we have introduced changes that do not allow us to correctly
measure performance or accuracy at this moment. Any activity at this
moment that collects metrics is faced with the challenge of collecting
values that might be bogus.

POWER5 machines have a per-hardware-thread register which counts at a
rate which is proportional to the percentage of cycles on which the
cpu dispatches an instruction for this thread (if the thread gets all
the dispatch cycles it counts at the same rate as the timebase
register).  This register is also context-switched by the hypervisor.
Thus it gives a fine-grained measure of the actual cpu usage by the
thread over time.

This patch builds on a patch submitted earlier. This patch provides
framework and data which allows other tools to report measurements
accurately to different tools.

This Patch calculates the amount of real physical time spent by the
processor in each USER/SYS mode. It calculates that by trapping
entry and exits into the kernel. The values after calculations
are avilable from /sys/devices/system/cpu/cpuX/dispatched_cycles.
These values are calculated during interrupts & context switches.

To be able to correctly report all cycles, it is important to be
able to track all the cycles that are given to lpars that are
either offline or have been removed since the system started.
All such cycles are calculated and stored in
/sys/devices/system/cpu/cpuX/offline_cpu_cycles

A few tools are in the works that will exploit the values being
calculated. Example output look like as follows.

%user   %sys    %wait   %idle
------  ------  ------  ------
00.90    0.09    0.00   99.01

This patch also keeps track of exact user/kernel times for each process
and updates them accordingly to be used by tools like CKRM.

I am working with performance group to calculate the impact
of this patch. I will add those numbers as soon something
becomes available.

Signed-off-by: Manish Ahuja <ahuja at austin.ibm.com>


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cpu_acct.patch.2
Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060210/9d849630/attachment.txt 


More information about the Linuxppc64-dev mailing list