mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5] MIPS: perf: MT fixes and improvements
@ 2018-04-03 12:31 Matt Redfearn
  2018-04-03 12:31 ` [PATCH 1/5] MIPS: perf: More robustly probe for the presence of per-tc counters Matt Redfearn
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Matt Redfearn @ 2018-04-03 12:31 UTC (permalink / raw)
  To: James Hogan, Ralf Baechle
  Cc: linux-mips, Matt Redfearn, Namhyung Kim, Maciej W. Rozycki,
	Peter Zijlstra, linux-kernel, Paul Burton, Ingo Molnar,
	Jiri Olsa, Alexander Shishkin, Arnaldo Carvalho de Melo

This series addresses a few issues with how the MIPS performance
counters code supports the hardware multithreading MT ASE.
Firstly, implementations of the MT ASE may implement performance counters
per core or per thread(TC). MIPS Techologies & BMIPS5000 implementations
signal this via a bit in the implmentation specific CONFIG7 register.
Since this register is implementation specific, checking it should be
guarded by a PRID check. This also replaces a bit defined by a magic
number.

Secondly, the code currently uses vpe_id(), defined as
smp_processor_id(), divided by 2, to share core performance counters
between VPEs. This relies on a couple of assumptions of the hardware
implementation to function correctly (always 2 VPEs per core, and the
hardware reading only the least significant bit).

Finally, the method of sharing core performance counters between VPEs is
suboptimal since it does not allow one process running on a VPE to use
all of the performance counters available to it, because the kernel will
reserve half of the coutners for the other VPE even if it may never use
them. This reservation at counter probe is replaced with an allocation
on use strategy.

Tested on a MIPS Creator CI40 (2C2T MIPS InterAptiv with per-TC
counters, though for the purposes of testing the per-TC availability was
hardcoded to allow testing both paths).

Series applies to v4.16-rc7



Matt Redfearn (5):
  MIPS: perf: More robustly probe for the presence of per-tc counters
  MIPS: perf: Use correct VPE ID when setting up VPE tracing
  MIPS: perf: Fix perf with MT counting other threads
  MIPS: perf: Allocate per-core counters on demand
  MIPS: perf: Fold vpe_id() macro into it's one last usage

 arch/mips/include/asm/mipsregs.h     |  10 ++
 arch/mips/kernel/perf_event_mipsxx.c | 257 +++++++++++++++++++++--------------
 2 files changed, 162 insertions(+), 105 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-04-03 20:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03 12:31 [PATCH 0/5] MIPS: perf: MT fixes and improvements Matt Redfearn
2018-04-03 12:31 ` [PATCH 1/5] MIPS: perf: More robustly probe for the presence of per-tc counters Matt Redfearn
2018-04-03 12:31 ` [PATCH 2/5] MIPS: perf: Use correct VPE ID when setting up VPE tracing Matt Redfearn
2018-04-03 12:31 ` [PATCH 3/5] MIPS: perf: Fix perf with MT counting other threads Matt Redfearn
2018-04-03 19:49   ` kbuild test robot
2018-04-03 12:31 ` [PATCH 4/5] MIPS: perf: Allocate per-core counters on demand Matt Redfearn
2018-04-03 20:34   ` kbuild test robot
2018-04-03 12:31 ` [PATCH 5/5] MIPS: perf: Fold vpe_id() macro into it's one last usage Matt Redfearn
2018-04-03 20:57   ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®