android_kernel_xiaomi_sm8350/include/asm-powerpc
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
..
iseries [POWERPC] iSeries: Move viodasd probing 2007-10-11 20:40:48 +10:00
8xx_immap.h [POWERPC] Copy over headers from arch/ppc to arch/powerpc that we need 2007-08-22 22:43:29 -05:00
8253pit.h
a.out.h arch: personality independent stack top 2007-07-19 10:04:45 -07:00
abs_addr.h
agp.h
asm-compat.h [POWERPC] Use mtocrf instruction in asm when CONFIG_POWER4_ONLY=y 2007-04-13 03:55:13 +10:00
atomic.h [POWERPC] Implement atomic{, 64}_{read, write}() without volatile 2007-08-17 11:01:58 +10:00
auxvec.h
backlight.h
bitops.h atomic.h: add atomic64 cmpxchg, xchg and add_unless to powerpc 2007-05-08 11:15:19 -07:00
bootx.h
btext.h
bug.h Fix WARN_ON() on bitfield ops 2007-07-31 21:12:07 -07:00
bugs.h
byteorder.h
cache.h [POWERPC] Add __read_mostly support for powerpc 2007-07-10 22:00:56 +10:00
cacheflush.h [POWERPC] DEBUG_PAGEALLOC for 32-bit 2007-04-13 04:09:39 +10:00
cell-pmu.h [POWERPC] cell: add cbe_node_to_cpu function 2007-04-23 21:44:38 +02:00
cell-regs.h [POWERPC] cell: Add Cell memory controller register defs and expose it 2007-10-09 21:01:56 +10:00
checksum.h [NET]: POWERPC checksum annotations and cleanups. 2006-12-02 21:23:20 -08:00
clk_interface.h [POWERPC] clk.h interface for platforms 2007-10-03 09:11:56 +10:00
commproc.h [POWERPC] cpm: Describe multi-user ram in its own device node. 2007-10-04 15:47:05 -05:00
compat.h Introduce compat_u64 and compat_s64 types 2007-07-16 09:05:48 -07:00
cpm2.h [POWERPC] 85xx: Killed <asm/mpc85xx.h> 2007-10-11 09:14:31 -05:00
cpm.h [POWERPC] cpm: Describe multi-user ram in its own device node. 2007-10-04 15:47:05 -05:00
cputable.h [POWERPC] Add 1TB workaround for PA6T 2007-10-17 22:30:09 +10:00
cputime.h
current.h [POWERPC] Include stddef.h in asm-powerpc/current.h to get offsetof 2007-03-09 15:03:24 +11:00
dbdma.h [POWERPC] Xserve cpu-meter driver 2006-12-04 20:39:30 +11:00
dcr-mmio.h Use dcr_host_t.base in dcr_unmap() 2007-10-15 14:29:49 -04:00
dcr-native.h Use dcr_host_t.base in dcr_unmap() 2007-10-15 14:29:49 -04:00
dcr.h [POWERPC] Compile fixes for arch/powerpc dcr code 2007-02-07 14:03:23 +11:00
delay.h
device.h [POWERPC] Refactor 64 bits DMA operations 2006-12-04 20:38:40 +11:00
div64.h
dma-mapping.h Fix powerpc breakage in sg chaining code 2007-10-16 13:10:58 -07:00
dma.h
edac.h [POWERPC] EDAC ECC software scrubber 2007-03-09 15:03:25 +11:00
eeh_event.h [POWERPC] EEH: rm un-needed data 2007-03-22 22:52:55 +11:00
eeh.h [POWERPC] Merge 32 and 64 bits asm-powerpc/io.h 2006-12-04 20:39:05 +11:00
elf.h increase AT_VECTOR_SIZE to terminate saved_auxv properly 2007-10-17 08:43:00 -07:00
emergency-restart.h
errno.h
exception.h [POWERPC] Move lowlevel runlatch calls under cpu feature control 2007-09-14 01:33:22 +10:00
fb.h fbdev: detect primary display device 2007-07-17 10:23:11 -07:00
fcntl.h
firmware.h [POWERPC] Only use H_BULK_REMOVE if the firmware supports it 2007-02-08 15:02:35 +11:00
floppy.h cleanup floppy.h 2007-10-17 08:42:55 -07:00
fs_pd.h [POWERPC] 85xx: Killed <asm/mpc85xx.h> 2007-10-11 09:14:31 -05:00
futex.h [PATCH] mm: pagefault_{disable,enable}() 2006-12-07 08:39:21 -08:00
grackle.h
hardirq.h
heathrow.h
highmem.h [POWERPC] Copy over headers from arch/ppc to arch/powerpc that we need 2007-08-22 22:43:29 -05:00
hvcall.h [POWERPC] Add H_ILLAN_ATTRIBUTES hcall number 2007-07-11 13:24:40 +10:00
hvconsole.h
hvcserver.h
hw_irq.h powerpc: fixup hard_irq_disable semantics 2007-05-11 08:29:34 -07:00
hydra.h [POWERPC] Copy over headers from arch/ppc to arch/powerpc that we need 2007-08-22 22:43:29 -05:00
i8259.h [POWERPC] Fix CHRP platforms with only 8259 2006-10-25 13:49:22 +10:00
ibmebus.h [POWERPC] ibmebus: Move to of_device and of_platform_driver, match eHCA and eHEA drivers 2007-10-17 22:30:08 +10:00
ide.h [POWERPC] Remove APUS support from arch/ppc 2007-09-17 15:15:04 +10:00
immap_86xx.h [POWERPC] 86xx: update immap_86xx.h for the 8610 2007-10-08 08:38:50 -05:00
immap_cpm2.h [POWERPC] cpm2: Infrastructure code cleanup. 2007-10-04 11:02:04 -05:00
immap_qe.h [POWERPC] qe: miscellaneous code improvements and fixes to the QE library 2007-10-08 08:38:15 -05:00
io-defs.h [POWERPC] Merge 32 and 64 bits asm-powerpc/io.h 2006-12-04 20:39:05 +11:00
io.h Remove dma_cache_(wback|inv|wback_inv) functions 2007-10-17 08:42:57 -07:00
ioctl.h
ioctls.h
iommu.h [POWERPC] DART iommu suspend 2007-05-07 20:31:14 +10:00
ipcbuf.h
ipic.h [POWERPC] 83xx: Return a point to the struct ipic from ipic_init() 2007-01-26 01:45:32 -06:00
irq_regs.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
irq.h [POWERPC] Add an optional device_node pointer to the irq_host 2007-09-14 01:33:20 +10:00
irqflags.h
Kbuild remove include/asm-*/ipc.h 2007-10-17 08:42:55 -07:00
kdebug.h x86: optimize page faults like all other achitectures and kill notifier cruft 2007-10-16 09:42:50 -07:00
kdump.h
kexec.h kdump/kexec: calculate note size at compile time 2007-05-08 11:15:07 -07:00
keylargo.h
kgdb.h [POWERPC] Copy over headers from arch/ppc to arch/powerpc that we need 2007-08-22 22:43:29 -05:00
kmap_types.h
kprobes.h kprobes: support kretprobe blacklist 2007-10-16 09:43:10 -07:00
libata-portmap.h Fix Maple PATA IRQ assignment. 2007-01-26 17:27:40 -05:00
linkage.h
lmb.h [POWERPC] Update lmb.h include protection to ASM_POWERPC 2007-08-17 11:01:58 +10:00
local.h local_t: powerpc extension 2007-05-08 11:15:20 -07:00
lppaca.h [POWERPC] Donate idle CPU cycles on dedicated partitions 2007-06-14 22:29:58 +10:00
lv1call.h [POWERPC] PS3: System-bus rework 2007-06-28 19:16:38 +10:00
machdep.h [POWERPC] Use 1TB segments 2007-10-12 14:05:17 +10:00
macio.h
mc146818rtc.h
mediabay.h
mman.h
mmu_context.h [POWERPC] Merge asm-ppc/mmu_context.h into asm-power/mmu_context.h 2007-07-03 03:22:05 -05:00
mmu-8xx.h [POWERPC] Split out asm-ppc/mmu.h portions for PowerPC 8xx 2007-07-03 03:00:28 -05:00
mmu-40x.h [POWERPC] 40x MMU 2007-08-20 07:28:48 -05:00
mmu-44x.h [POWERPC] Remove fixup_bigphys_addr() for arch/powerpc to avoid link error 2007-05-17 21:11:13 +10:00
mmu-fsl-booke.h [POWERPC] Split out asm-ppc/mmu.h portions for Freescale Book-E 2007-07-03 03:00:16 -05:00
mmu-hash32.h [POWERPC] Kill typedef-ed structs for hash PTEs and BATs 2007-06-14 22:30:16 +10:00
mmu-hash64.h [POWERPC] Use 1TB segments 2007-10-12 14:05:17 +10:00
mmu.h [POWERPC] 40x MMU 2007-08-20 07:28:48 -05:00
mmzone.h [POWERPC] We don't define CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID 2007-05-10 21:28:13 +10:00
module.h [POWERPC] Generic BUG for powerpc 2006-12-11 16:35:07 +11:00
mpc8xx.h [POWERPC] 8xx: mpc885ads pcmcia support 2007-07-10 00:33:51 -05:00
mpc52xx_psc.h [POWERPC] Copy over headers from arch/ppc to arch/powerpc that we need 2007-08-22 22:43:29 -05:00
mpc52xx.h PM: Rework struct platform_suspend_ops 2007-10-18 14:37:18 -07:00
mpc86xx.h [POWERPC] kill isa_{io,mem}_base definitions for !PCI 2007-06-29 01:56:43 -05:00
mpc8260.h [POWERPC] Change include protections to ASM_POWERPC 2007-05-17 21:10:15 +10:00
mpic.h [POWERPC] Update mpic to use dcr_host_t.base 2007-10-03 13:25:27 +10:00
msgbuf.h
mutex.h
namei.h
nvram.h [POWERPC] pseries: Eliminate global error_log_cnt variable 2007-08-17 11:01:52 +10:00
of_device.h [POWERPC] Move of_device allocation into of_device.[ch] 2007-10-17 22:30:07 +10:00
of_platform.h Create linux/of_platorm.h 2007-07-20 14:25:22 +10:00
ohare.h
oprofile_impl.h [CELL] oprofile: add support to OProfile for profiling CELL BE SPUs 2007-07-20 21:42:24 +02:00
paca.h powerpc: add scaled time accounting 2007-10-18 14:37:28 -07:00
page_32.h [POWERPC] Kill off the PTE_FMT macro 2007-05-07 20:31:14 +10:00
page_64.h [POWERPC] Use 1TB segments 2007-10-12 14:05:17 +10:00
page.h fix 'dynreloc miscount' link error on Powerpc 2007-07-26 11:35:18 -07:00
param.h
parport.h parport->dev driver model support 2007-05-08 11:15:05 -07:00
pci-bridge.h [POWERPC] PCI: Add 64-bit physical address support to setup_indirect_pci 2007-10-12 14:05:17 +10:00
pci.h Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2007-07-16 17:58:08 -07:00
percpu.h [POWERPC] ppc64: support CONFIG_DEBUG_PREEMPT 2007-10-03 11:48:44 +10:00
pgalloc-32.h [POWERPC] Remove use of 4level-fixup.h for ppc32 2007-05-08 13:40:31 +10:00
pgalloc-64.h [POWERPC] Fix return from pte_alloc_one() in out-of-memory case 2007-06-02 21:01:56 +10:00
pgalloc.h [POWERPC] Remove arch/powerpc's dependence on asm-ppc/pg{alloc,table}.h 2007-05-02 20:04:30 +10:00
pgtable-4k.h [POWERPC] Size swapper_pg_dir correctly 2007-09-19 15:25:34 +10:00
pgtable-64k.h [POWERPC] Size swapper_pg_dir correctly 2007-09-19 15:25:34 +10:00
pgtable-ppc32.h mm: remove ptep_test_and_clear_dirty and ptep_clear_flush_dirty 2007-07-17 10:22:59 -07:00
pgtable-ppc64.h ppc64: SPARSEMEM_VMEMMAP support 2007-10-16 09:42:51 -07:00
pgtable.h [POWERPC] Start factoring pgtable-ppc32.h and pgtable-ppc64.h 2007-06-14 22:30:15 +10:00
pmac_feature.h [POWERPC] Change include protections to ASM_POWERPC 2007-05-17 21:10:15 +10:00
pmac_low_i2c.h
pmac_pfunc.h
pmc.h [POWERPC] pasemi: PA6T oprofile support 2007-04-24 21:31:51 +10:00
pmi.h [CELL] pmi: remove support for mutiple devices. 2007-07-20 21:41:34 +02:00
poll.h Consolidate asm/poll.h 2007-05-11 08:29:34 -07:00
posix_types.h [PATCH] FD_ZERO build fix 2007-01-11 18:18:22 -08:00
ppc_asm.h [POWERPC] Fix modpost warnings from head*.S on ppc32 2007-09-14 08:53:36 -05:00
ppc-pci.h [POWERPC] Rewrite IO allocation & mapping on powerpc64 2007-06-14 22:29:56 +10:00
processor.h [POWERPC] Use __attribute__ in asm-powerpc 2007-09-22 14:49:21 +10:00
prom.h [POWERPC] Use strcasecmp() rather than strncasecmp() when determining device node compatibility 2007-08-22 15:21:47 +10:00
ps3.h [POWERPC] PS3: Add new LV1 error codes 2007-09-14 01:33:25 +10:00
ps3av.h ps3av: dont distinguish between boot' and non-boot' autodetection 2007-10-16 09:43:21 -07:00
ps3fb.h [POWERPC] PS3: Frame buffer system-bus rework 2007-06-28 19:16:42 +10:00
ps3stor.h [POWERPC] PS3: Storage Driver Core 2007-06-28 19:19:20 +10:00
pSeries_reconfig.h
ptrace.h [POWERPC] Uninline common ptrace bits 2007-06-14 22:29:57 +10:00
qe_ic.h [POWERPC] QEIC: Implement pluggable handlers, fix MPIC cascading 2007-10-08 08:38:57 -05:00
qe.h [POWERPC] qe: miscellaneous code improvements and fixes to the QE library 2007-10-08 08:38:15 -05:00
reg_8xx.h
reg_booke.h [POWERPC] Fix FSL BookE machine check reporting 2007-08-17 13:22:28 -05:00
reg.h [POWERPC] Remove APUS support from arch/ppc 2007-09-17 15:15:04 +10:00
resource.h
rheap.h [POWERPC] User rheap from arch/powerpc/lib 2007-05-09 23:28:17 -05:00
rtas.h [POWERPC] Add rtas_service_present() helper 2006-12-08 17:10:22 +11:00
rtc.h
rwsem.h [POWERPC] Prevent direct inclusion of <asm/rwsem.h>. 2007-09-22 14:49:21 +10:00
scatterlist.h PPC: sg chaining support 2007-10-16 11:27:32 +02:00
seccomp.h
sections.h
semaphore.h kill DECLARE_MUTEX_LOCKED 2007-10-17 08:42:47 -07:00
sembuf.h
serial.h
setup.h [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h Convert cpu_sibling_map to be a per cpu variable 2007-10-16 09:42:50 -07:00
smu.h
socket.h [NET]: Adding SO_TIMESTAMPNS / SCM_TIMESTAMPNS support 2007-04-25 22:24:21 -07:00
sockios.h [NET]: Introduce SIOCGSTAMPNS ioctl to get timestamps with nanosec resolution 2007-04-25 22:24:04 -07:00
sparsemem.h [POWERPC] ps3: add lpar addressing 2006-12-04 20:40:52 +11:00
spinlock_types.h
spinlock.h
spu_csa.h [CELL] spufs: fix decr_status meanings 2007-07-20 21:41:55 +02:00
spu_info.h [POWERPC] spufs: Add /lslr, /dma_info and /proxydma files 2006-12-04 20:39:45 +11:00
spu_priv1.h [POWERPC] cell: Move SPU affinity init to spu_management_of_ops 2007-08-10 21:04:21 +10:00
spu.h [POWERPC] spufs: Handle errors in SPU coredump code, and support coredump to a pipe 2007-09-19 15:12:19 +10:00
sstep.h [POWERPC] Added kprobes support to ppc32 2007-02-06 22:55:19 -06:00
stat.h
statfs.h
string.h [STRING]: Move strcasecmp/strncasecmp to lib/string.c 2007-04-26 01:54:39 -07:00
suspend.h [POWERPC] Fix suspend states again 2007-05-02 20:04:30 +10:00
synch.h
syscalls.h [POWERPC] Consolidate sys_sigaltstack 2007-06-14 22:29:57 +10:00
systbl.h sys_fallocate() implementation on i386, x86_64 and powerpc 2007-07-17 21:42:44 -04:00
system.h increase AT_VECTOR_SIZE to terminate saved_auxv properly 2007-10-17 08:43:00 -07:00
tce.h [POWERPC] Use 4kB iommu pages even on 64kB-page systems 2006-11-01 14:52:48 +11:00
termbits.h [POWERPC] Enable arbitary speed tty ioctls and split input/output speed 2007-07-10 22:03:29 +10:00
termios.h [PATCH] consolidate line discipline number definitions 2007-02-11 10:51:26 -08:00
thread_info.h remove unused TIF_NOTIFY_RESUME flag 2007-07-31 15:39:38 -07:00
time.h [POWERPC] Implement clockevents driver for powerpc 2007-10-03 15:44:34 +10:00
timex.h [POWERPC] Cell timebase bug workaround 2006-10-25 11:54:18 +10:00
tlb.h [POWERPC] Include pagemap.h in asm/powerpc/tlb.h 2007-10-03 12:02:43 +10:00
tlbflush.h [POWERPC] Use 1TB segments 2007-10-12 14:05:17 +10:00
topology.h Convert cpu_sibling_map to be a per cpu variable 2007-10-16 09:42:50 -07:00
tsi108_irq.h [POWERPC] Change include protections to ASM_POWERPC 2007-05-17 21:10:15 +10:00
tsi108_pci.h [POWERPC] Change include protections to ASM_POWERPC 2007-05-17 21:10:15 +10:00
tsi108.h [POWERPC] Generalize tsi108 PCI setup 2007-05-08 11:54:20 +10:00
types.h remove strict ansi check from __u64 in asm/types.h 2007-10-17 08:42:53 -07:00
uaccess.h [POWERPC] Add inatomic versions of __get_user and __put_user 2007-04-13 04:09:38 +10:00
ucc_fast.h ucc_geth: Implement Transmit on Demand support 2007-04-28 11:01:04 -04:00
ucc_slow.h [POWERPC] qe: miscellaneous code improvements and fixes to the QE library 2007-10-08 08:38:15 -05:00
ucc.h [POWERPC] qe: miscellaneous code improvements and fixes to the QE library 2007-10-08 08:38:15 -05:00
ucontext.h
udbg.h [POWERPC] Add early debug console for CPM serial ports. 2007-10-03 20:35:43 -05:00
uic.h [POWERPC] Add arch/powerpc driver for UIC, PPC4xx interrupt controller 2007-04-24 21:32:01 +10:00
unaligned.h
uninorth.h
unistd.h sys_fallocate() implementation on i386, x86_64 and powerpc 2007-07-17 21:42:44 -04:00
user.h
vdso_datapage.h
vdso.h [POWERPC] Fix vDSO page count calculation 2007-02-13 15:35:52 +11:00
vga.h
vio.h [POWERPC] Clean up vio.h 2007-10-11 20:40:44 +10:00
xilinx_intc.h [POWERPC] Virtex: add xilinx interrupt controller driver 2007-10-03 07:23:14 -05:00
xmon.h [POWERPC] add support for stopping spus from xmon 2006-10-25 14:20:22 +10:00
xor.h