linux/arch/powerpc/perf
Anju T Sudhakar 9c9f8fb71f powerpc/perf: Use cpumask_last() to determine the designated cpu for nest/core units.
Nest and core IMC (In-Memory Collection counters) assigns a particular
cpu as the designated target for counter data collection. During
system boot, the first online cpu in a chip gets assigned as the
designated cpu for that chip(for nest-imc) and the first online cpu in
a core gets assigned as the designated cpu for that core(for
core-imc).

If the designated cpu goes offline, the next online cpu from the same
chip(for nest-imc)/core(for core-imc) is assigned as the next target,
and the event context is migrated to the target cpu. Currently,
cpumask_any_but() function is used to find the target cpu. Though this
function is expected to return a `random` cpu, this always returns the
next online cpu.

If all cpus in a chip/core is offlined in a sequential manner,
starting from the first cpu, the event migration has to happen for all
the cpus which goes offline. Since the migration process involves a
grace period, the total time taken to offline all the cpus will be
significantly high.

Example:
  In a system which has 2 sockets, with
  NUMA node0 CPU(s):     0-87
  NUMA node8 CPU(s):     88-175

  Time taken to offline cpu 88-175:
  real    2m56.099s
  user    0m0.191s
  sys     0m0.000s

Use cpumask_last() to choose the target cpu, when the designated cpu
goes online, so the migration will happen only when the last_cpu in
the mask goes offline. This way the time taken to offline all cpus in
a chip/core can be reduced.

With the patch:

  Time taken  to offline cpu 88-175:
  real    0m12.207s
  user    0m0.171s
  sys     0m0.000s

Offlining all cpus in reverse order is also taken care because,
cpumask_any_but() is used to find the designated cpu if the last cpu
in the mask goes offline. Since cpumask_any_but() always return the
first cpu in the mask, that becomes the designated cpu and migration
will happen only when the first_cpu in the mask goes offline.

Example: With the patch,

  Time taken to offline cpu from 175-88:
  real    0m9.330s
  user    0m0.110s
  sys     0m0.000s

Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2019-06-19 20:05:09 +10:00
..
req-gen powerpc: clean the inclusion of stringify.h 2018-07-30 22:48:17 +10:00
8xx-pmu.c powerpc/8xx: Use patch_site for perf counters setup 2018-10-26 21:58:58 +11:00
bhrb.S
callchain.c powerpc/mm: Rename find_linux_pte_or_hugepte() 2017-08-17 23:13:46 +10:00
core-book3s.c powerpc/perf: Add generic compat mode pmu driver 2019-05-03 02:54:58 +10:00
core-fsl-emb.c powerpc/pmu/fsl: fix is_nmi test for irq mask change 2018-06-03 20:40:29 +10:00
e500-pmu.c
e6500-pmu.c
generic-compat-pmu.c powerpc/perf: Add generic compat mode pmu driver 2019-05-03 02:54:58 +10:00
hv-24x7-catalog.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-24x7-domains.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-24x7.c perf/core, arch/powerpc: use PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs 2019-01-21 11:01:26 +01:00
hv-24x7.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-common.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-gpci-requests.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hv-gpci.c perf/core, arch/powerpc: use PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs 2019-01-21 11:01:26 +01:00
hv-gpci.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
imc-pmu.c powerpc/perf: Use cpumask_last() to determine the designated cpu for nest/core units. 2019-06-19 20:05:09 +10:00
internal.h powerpc/perf: Add generic compat mode pmu driver 2019-05-03 02:54:58 +10:00
isa207-common.c powerpc/perf: Add constraints for power9 l2/l3 bus events 2018-12-20 20:53:11 +11:00
isa207-common.h powerpc/perf: Add constraints for power9 l2/l3 bus events 2018-12-20 20:53:11 +11:00
Makefile powerpc/perf: Add generic compat mode pmu driver 2019-05-03 02:54:58 +10:00
mpc7450-pmu.c powerpc/perf: Pass the struct perf_events down to compute_mmcr() 2014-07-28 14:30:47 +10:00
perf_regs.c powerpc/perf: Update perf_regs structure to include MMCRA 2019-01-08 19:22:47 +11:00
power5+-pmu.c powerpc/perf: init pmu from core-book3s 2019-05-03 02:54:58 +10:00
power5-pmu.c powerpc/perf: init pmu from core-book3s 2019-05-03 02:54:58 +10:00
power6-pmu.c powerpc/perf: init pmu from core-book3s 2019-05-03 02:54:58 +10:00
power7-events-list.h
power7-pmu.c powerpc/perf: init pmu from core-book3s 2019-05-03 02:54:58 +10:00
power8-events-list.h powerpc/perf: Add Power8 mem_access event to sysfs 2017-04-19 20:00:23 +10:00
power8-pmu.c powerpc/perf: init pmu from core-book3s 2019-05-03 02:54:58 +10:00
power9-events-list.h powerpc/perf: Remove PM_BR_CMPL_ALT from power9 event list 2019-05-03 02:54:59 +10:00
power9-pmu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 112 2019-05-24 17:39:01 +02:00
ppc970-pmu.c powerpc/perf: init pmu from core-book3s 2019-05-03 02:54:58 +10:00