• Paul Mackerras's avatar
    [PATCH] ppc64: collect and export low-level cpu usage statistics · 8e901443
    Paul Mackerras authored
    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 adds code to read this register every timer interrupt and on
    every context switch.  The total over all virtual processors is available
    through the existing /proc/ppc64/lparcfg file, giving a way to measure the
    total cpu usage over the whole partition.
    Signed-off-by: default avatarManish Ahuja <ahuja@austin.ibm.com>
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    8e901443
processor.h 26.7 KB