kernel-ark/arch/powerpc/kernel
Michael Neuling 4603ac180a powerpc: add scaled time accounting
This adds POWERPC specific hooks for scaled time accounting.

POWER6 includes a SPURR register.  The SPURR is based off the PURR register
but is scaled based on CPU frequency and issue rates.  This gives a more
accurate account of the instructions used per task.  The PURR and timebase
will be constant relative to the wall clock, irrespective of the CPU
frequency.

This implementation reads the SPURR register in account_system_vtime which
is only call called on context witch and hard and soft irq entry and exit.
The percentage of user and system time is then estimated using the ratio of
these accounted by the PURR.  If the SPURR is not present, the PURR read.

An earlier implementation of this patch read the SPURR whenever the PURR
was read, which included the system call entry and exit path.
Unfortunately this showed a performance regression on lmbench runs, so was
re-implemented.

I've included the lmbench results here when run bare metal on POWER6.  1st
column is the unpatch results.  2nd column is the results using the below
patch and the 3rd is the % diff of these results from the base.  4th and
5th columns are the results and % differnce from the base using the older
patch (SPURR read in syscall entry/exit path).

                              Base        Scaled-Acct     SPURR-in-syscall
                             Result      Result  % diff    Result % diff
Simple syscall:              0.3086      0.3086  0.0000    0.3452 11.8600
Simple read:                 0.4591      0.4671  1.7425    0.5044 9.86713
Simple write:                0.4364      0.4366  0.0458    0.4731 8.40971
Simple stat:                 2.0055      2.0295  1.1967    2.0669 3.06158
Simple fstat:                0.5962      0.5876  -1.442    0.6368 6.80979
Simple open/close:           3.1283      3.1009  -0.875    3.2088 2.57328
Select on 10 fd's:           0.8554      0.8457  -1.133    0.8667 1.32101
Select on 100 fd's:          3.5292      3.6329  2.9383    3.6664 3.88756
Select on 250 fd's:          7.9097      8.1881  3.5197    8.2242 3.97613
Select on 500 fd's:          15.2659     15.836  3.7357    15.873 3.97814
Select on 10 tcp fd's:       0.9576      0.9416  -1.670    0.9752 1.83792
Select on 100 tcp fd's:      7.248       7.2254  -0.311    7.2685 0.28283
Select on 250 tcp fd's:      17.7742     17.707  -0.375    17.749 -0.1406
Select on 500 tcp fd's:      35.4258     35.25   -0.496    35.286 -0.3929
Signal handler installation: 0.6131      0.6075  -0.913    0.647  5.52927
Signal handler overhead:     2.0919      2.1078  0.7600    2.1831 4.35967
Protection fault:            0.7345      0.7478  1.8107    0.8031 9.33968
Pipe latency:                33.006      16.398  -50.31    33.475 1.42368
AF_UNIX sock stream latency: 14.5093     30.910  113.03    30.715 111.692
Process fork+exit:           219.8       222.8   1.3648    229.37 4.35623
Process fork+execve:         876.14      873.28  -0.32     868.66 -0.8533
Process fork+/bin/sh -c:     2830        2876.5  1.6431    2958   4.52296
File /var/tmp/XXX write bw:  1193497     1195536 0.1708    118657 -0.5799
Pagefaults on /var/tmp/XXX:  3.1272      3.2117  2.7020    3.2521 3.99398

Also, kernel compile times show no difference with this patch applied.

[pbadari@us.ibm.com: Avoid unnecessary PURR reading]
Signed-off-by: Michael Neuling <mikey@neuling.org>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Jay Lan <jlan@engr.sgi.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-18 14:37:28 -07:00
..
vdso32 powerpc32 vDSO: linker script indentation 2007-10-16 10:01:50 -07:00
vdso64 [POWERPC] Fix 64 bits vDSO DWARF info for CR register 2007-10-17 22:30:09 +10:00
align.c [POWERPC] Handle alignment faults on SPE load/store instructions 2007-09-14 08:51:48 -05:00
asm-offsets.c powerpc: add scaled time accounting 2007-10-18 14:37:28 -07:00
audit.c
binfmt_elf32.c powerpc: Use linux/elfcore-compat.h 2007-10-17 08:42:51 -07:00
btext.c [POWERPC] Clean out a bunch of duplicate includes 2007-08-17 11:01:51 +10:00
clock.c [POWERPC] clk.h interface for platforms 2007-10-03 09:11:56 +10:00
compat_audit.c
cpu_setup_6xx.S
cpu_setup_44x.S [POWERPC] 4xx: 440EPx/GRx incorrect write to DDR SDRAM errata workaround 2007-10-03 07:20:18 -05:00
cpu_setup_pa6t.S
cpu_setup_ppc970.S
cputable.c [POWERPC] 4xx: Add AMCC 405EX support to cputable.c 2007-10-11 15:01:22 -05:00
crash_dump.c [POWERPC] FWNMI is only used on pSeries 2007-09-19 15:25:34 +10:00
crash.c [POWERPC] Clean out a bunch of duplicate includes 2007-08-17 11:01:51 +10:00
dma_64.c PPC: sg chaining support 2007-10-16 11:27:32 +02:00
entry_32.S [POWERPC] Add cpu feature for SPE handling 2007-09-14 08:53:30 -05:00
entry_64.S [POWERPC] Add 1TB workaround for PA6T 2007-10-17 22:30:09 +10:00
firmware.c
fpu.S
head_8xx.S [POWERPC] 8xx: Work around CPU15 erratum. 2007-10-03 20:36:36 -05:00
head_32.S [POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers 2007-10-11 13:36:52 -05:00
head_40x.S [POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers 2007-10-11 13:36:52 -05:00
head_44x.S [POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers 2007-10-11 13:36:52 -05:00
head_64.S [POWERPC] Use 1TB segments 2007-10-12 14:05:17 +10:00
head_booke.h
head_fsl_booke.S [POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers 2007-10-11 13:36:52 -05:00
ibmebus.c [POWERPC] ibmebus: Move to of_device and of_platform_driver, match eHCA and eHEA drivers 2007-10-17 22:30:08 +10:00
idle_6xx.S
idle_power4.S
idle.c [POWERPC] Enable tickless idle and high res timers for powerpc 2007-10-03 15:44:34 +10:00
init_task.c
io.c
iomap.c [POWERPC] Add 64-bit resources support to pci_iomap 2007-09-20 07:36:52 -05:00
iommu.c PPC: sg chaining support 2007-10-16 11:27:32 +02:00
irq.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2007-10-11 21:55:47 -07:00
isa-bridge.c
kprobes.c kprobes: support kretprobe blacklist 2007-10-16 09:43:10 -07:00
l2cr_6xx.S
legacy_serial.c [POWERPC] Add legacy serial support for OPB with flattened device tree 2007-10-12 14:05:18 +10:00
lparcfg.c [POWERPC] ppc64: support CONFIG_DEBUG_PREEMPT 2007-10-03 11:48:44 +10:00
machine_kexec_32.c
machine_kexec_64.c
machine_kexec.c
Makefile [POWERPC] 8xx: Move softemu8xx.c from arch/ppc 2007-10-04 11:02:54 -05:00
misc_32.S [POWERPC] Fix small race in 44x tlbie function 2007-08-15 15:12:50 +10:00
misc_64.S
misc.S
module_32.c
module_64.c
msi.c
nvram_64.c [POWERPC] pseries: Eliminate global error_log_cnt variable 2007-08-17 11:01:52 +10:00
of_device.c [POWERPC] Move of_device allocation into of_device.[ch] 2007-10-17 22:30:07 +10:00
of_platform.c [POWERPC] Move of_device allocation into of_device.[ch] 2007-10-17 22:30:07 +10:00
paca.c
pci_32.c [POWERPC] null_pci_ops: Use named structure member initializers 2007-08-17 11:01:53 +10:00
pci_64.c [POWERPC] Fix pci domain detection 2007-10-03 11:48:44 +10:00
pci_dn.c [POWERPC] Fix section mismatch in PCI code 2007-09-19 15:25:34 +10:00
pci-common.c [POWERPC] Use alloc_maybe_bootmem() in pcibios_alloc_controller 2007-10-03 15:31:35 +10:00
pmc.c
ppc32.h
ppc_ksyms.c [POWERPC] Fix build errors when BLOCK=n 2007-09-22 14:49:22 +10:00
proc_ppc64.c
process.c powerpc: add Altivec/VMX state to coredumps 2007-10-17 08:42:44 -07:00
prom_init.c [POWERPC] prom_init whitespace cleanup, typo fix 2007-09-14 01:33:24 +10:00
prom_parse.c Revert "[POWERPC] Don't complain if size-cells == 0 in prom_parse()" 2007-07-26 13:44:36 +10:00
prom.c [POWERPC] Use cache-inhibited large page bit from firmware 2007-10-09 21:00:48 +10:00
ptrace32.c [POWERPC] Add CHECK_FULL_REGS in several places in ptrace code 2007-10-03 11:48:43 +10:00
ptrace.c Consolidate PTRACE_DETACH 2007-10-16 09:42:49 -07:00
rtas_flash.c Slab API: remove useless ctor parameter and reorder parameters 2007-10-17 08:42:45 -07:00
rtas_pci.c [POWERPC] rtas_pci_ops: Use named structure member initializers 2007-08-17 11:01:53 +10:00
rtas-proc.c
rtas-rtc.c
rtas.c
semaphore.c
setup_32.c [POWERPC] Only call ppc_md.setup_arch() if it is provided 2007-10-11 20:39:36 +10:00
setup_64.c [POWERPC] Quieten cache information at boot 2007-10-17 22:30:09 +10:00
setup-common.c Convert cpu_sibling_map to be a per cpu variable 2007-10-16 09:42:50 -07:00
setup.h
signal_32.c [POWERPC] Implement logging of unhandled signals 2007-10-12 14:05:18 +10:00
signal_64.c [POWERPC] Implement logging of unhandled signals 2007-10-12 14:05:18 +10:00
signal.c [POWERPC] Implement logging of unhandled signals 2007-10-12 14:05:18 +10:00
signal.h
smp-tbsync.c
smp.c Convert cpu_sibling_map to be a per cpu variable 2007-10-16 09:42:50 -07:00
softemu8xx.c [POWERPC] 8xx: Move softemu8xx.c from arch/ppc 2007-10-04 11:02:54 -05:00
suspend.c
swsusp_32.S
swsusp_64.c
swsusp_asm64.S
swsusp.c
sys_ppc32.c remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
syscalls.c remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
sysfs.c [POWERPC] Remove warning in arch/powerpc/kernel/sysfs.c 2007-09-14 01:33:22 +10:00
systbl.S [POWERPC] Align the sys_call_table 2007-10-11 14:36:47 +10:00
tau_6xx.c
time.c powerpc: add scaled time accounting 2007-10-18 14:37:28 -07:00
traps.c [POWERPC] Implement logging of unhandled signals 2007-10-12 14:05:18 +10:00
udbg_16550.c [POWERPC] 4xx: Implement udbg_getc() for 440 2007-09-19 21:13:17 -05:00
udbg.c [POWERPC] Add early debug console for CPM serial ports. 2007-10-03 20:35:43 -05:00
vdso.c [POWERPC] Disable vDSO support for ARCH=ppc where it's not implemented 2007-10-11 20:25:25 +10:00
vecemu.c
vector.S
vio.c Driver core: change add_uevent_var to use a struct 2007-10-12 14:51:01 -07:00
vmlinux.lds.S [POWERPC] Fix modpost warnings from head*.S on ppc32 2007-09-14 08:53:36 -05:00