Thread (4 messages) 4 messages, 3 authors, 2019-02-22

[PATCH] powerpc/pseries: export timebase register sample in lparcfg

flat view
STALE2793d

From: Tyrel Datwyler <hidden>
Date: 2018-12-08 23:50:38
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

The Processor Utilzation of Resource Registers (PURR) provide an estimate of
resources used by a cpu thread. Section 7.6 in Book III of the ISA outlines
how to calculate the percentage of shared resources for threads using the
ratio of the PURR delta and Timebase Register delta for a sampled period.

This calculation is currently done erroneously by the lparstat tool from the
powerpc-utils package. This patch exports the current timebase value after
we sample the PURRs and exposes it to userspace accounting tools via
/proc/ppc64/lparcfg.

Signed-off-by: Tyrel Datwyler <redacted>
---
 arch/powerpc/platforms/pseries/lparcfg.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c
index 7944873..1ea73ec 100644
--- a/arch/powerpc/platforms/pseries/lparcfg.c
+++ b/arch/powerpc/platforms/pseries/lparcfg.c
@@ -475,6 +475,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
 		splpar_dispatch_data(m);
 
 		seq_printf(m, "purr=%ld\n", get_purr());
+        seq_printf(m, "tbr=%ld\n", mftb());
 	} else {		/* non SPLPAR case */
 
 		seq_printf(m, "system_active_processors=%d\n",
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help