mirror of https://gitee.com/openkylin/linux.git
c6622f63db
This implements accurate task and cpu time accounting for 64-bit powerpc kernels. Instead of accounting a whole jiffy of time to a task on a timer interrupt because that task happened to be running at the time, we now account time in units of timebase ticks according to the actual time spent by the task in user mode and kernel mode. We also count the time spent processing hardware and software interrupts accurately. This is conditional on CONFIG_VIRT_CPU_ACCOUNTING. If that is not set, we do tick-based approximate accounting as before. To get this accurate information, we read either the PURR (processor utilization of resources register) on POWER5 machines, or the timebase on other machines on * each entry to the kernel from usermode * each exit to usermode * transitions between process context, hard irq context and soft irq context in kernel mode * context switches. On POWER5 systems with shared-processor logical partitioning we also read both the PURR and the timebase at each timer interrupt and context switch in order to determine how much time has been taken by the hypervisor to run other partitions ("steal" time). Unfortunately, since we need values of the PURR on both threads at the same time to accurately calculate the steal time, and since we can only calculate steal time on a per-core basis, the apportioning of the steal time between idle time (time which we ceded to the hypervisor in the idle loop) and actual stolen time is somewhat approximate at the moment. This is all based quite heavily on what s390 does, and it uses the generic interfaces that were added by the s390 developers, i.e. account_system_time(), account_user_time(), etc. This patch doesn't add any new interfaces between the kernel and userspace, and doesn't change the units in which time is reported to userspace by things such as /proc/stat, /proc/<pid>/stat, getrusage(), times(), etc. Internally the various task and cpu times are stored in timebase units, but they are converted to USER_HZ units (1/100th of a second) when reported to userspace. Some precision is therefore lost but there should not be any accumulating error, since the internal accumulation is at full precision. Signed-off-by: Paul Mackerras <paulus@samba.org> |
||
---|---|---|
.. | ||
8xx_immap.h | ||
amigahw.h | ||
amigaints.h | ||
amigappc.h | ||
amigayle.h | ||
amipcmcia.h | ||
ans-lcd.h | ||
bootinfo.h | ||
bootx.h | ||
btext.h | ||
commproc.h | ||
cpm2.h | ||
delay.h | ||
floppy.h | ||
gg2.h | ||
gt64260.h | ||
gt64260_defs.h | ||
harrier.h | ||
hawk.h | ||
hawk_defs.h | ||
highmem.h | ||
hydra.h | ||
ibm4xx.h | ||
ibm44x.h | ||
ibm403.h | ||
ibm405.h | ||
ibm_ocp.h | ||
ibm_ocp_pci.h | ||
immap_85xx.h | ||
immap_cpm2.h | ||
io.h | ||
kgdb.h | ||
m48t35.h | ||
m8260_pci.h | ||
machdep.h | ||
md.h | ||
mk48t59.h | ||
mmu.h | ||
mmu_context.h | ||
mpc8xx.h | ||
mpc10x.h | ||
mpc52xx.h | ||
mpc52xx_psc.h | ||
mpc83xx.h | ||
mpc85xx.h | ||
mpc8260.h | ||
mpc8260_pci9.h | ||
mv64x60.h | ||
mv64x60_defs.h | ||
ocp.h | ||
ocp_ids.h | ||
open_pic.h | ||
page.h | ||
pc_serial.h | ||
pci-bridge.h | ||
pci.h | ||
pgalloc.h | ||
pgtable.h | ||
pnp.h | ||
ppc4xx_dma.h | ||
ppc4xx_pic.h | ||
ppc_sys.h | ||
ppcboot.h | ||
prep_nvram.h | ||
prom.h | ||
raven.h | ||
reg_booke.h | ||
residual.h | ||
rheap.h | ||
rio.h | ||
rtc.h | ||
serial.h | ||
smp.h | ||
spinlock.h | ||
suspend.h | ||
system.h | ||
time.h | ||
todc.h | ||
traps.h | ||
zorro.h |