OSDN Git Service

powerpc/pseries: lparcfg calculate PURR on demand
authorNicholas Piggin <npiggin@gmail.com>
Fri, 4 May 2018 17:19:30 +0000 (03:19 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 3 Jun 2018 10:40:27 +0000 (20:40 +1000)
commit3d3a6021ddcbe9c31520e4e7b65e5ce5dc58274d
tree10d300ac9f4f3b8354b9e35075d3d5a776739e7e
parent36d632ea831fd2fa3cb62599a465825f59076f64
powerpc/pseries: lparcfg calculate PURR on demand

For SPLPAR, lparcfg provides a sum of PURR registers for all CPUs.
Currently this is done by reading PURR in context switch and timer
interrupt, and storing that into a per-CPU variable. These are summed
to provide the value.

This does not work with all timer schemes (e.g., NO_HZ_FULL), and it
is sub-optimal for performance because it reads the PURR register on
every context switch, although that's been difficult to distinguish
from noise in the contxt_switch microbenchmark.

This patch implements the sum by calling a function on each CPU, to
read and add PURR values of each CPU.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/time.h
arch/powerpc/kernel/process.c
arch/powerpc/kernel/time.c
arch/powerpc/platforms/pseries/lparcfg.c