linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 00/16] perf: Fix the throttle logic for group
@ 2025-05-16 18:28 kan.liang
  2025-05-16 18:28 ` [PATCH V3 01/16] perf: Clean up event in freq mode check kan.liang
                   ` (15 more replies)
  0 siblings, 16 replies; 23+ messages in thread
From: kan.liang @ 2025-05-16 18:28 UTC (permalink / raw)
  To: peterz, mingo, namhyung, irogers, mark.rutland, linux-kernel,
	linux-perf-users
  Cc: eranian, ctshao, tmricht, leo.yan, Kan Liang

From: Kan Liang <kan.liang@linux.intel.com>

Changes since V2:
- Add a cleanup patch to check if an event is in freq mode
- Rename the parameter of the perf_event_unthrottle_group()
- Add Tested-by from Leo and Thomas
- Add Acked-by from Guo Ren

Changes since V1:
- Apply the suggested throttle/unthrottle functions from Peter.
  The MAX_INTERRUPTS and throttle logs are applied to all events.
- Update the description and comments accordingly
- Add Reviewed-by from Ravi and Max

The sampling read doesn't work well with a group.
The issue was originally found by the 'Basic leader sampling test' case
failed on s390.
https://lore.kernel.org/all/20250228062241.303309-1-tmricht@linux.ibm.com/

Stephane debugged it and found it was caused by the throttling logic.
https://lore.kernel.org/all/CABPqkBQzCMNS_PfLZBWVuX9o8Z55PovwJvpVWMWzyeExFJ5R4Q@mail.gmail.com/

The throttle logic is generic and shared by all ARCHs.
It also impacts other ARCHs, e.g., X86.

On an Intel GNR machine,
$ perf record -e "{cycles,cycles}:S" ...

$ perf report -D | grep THROTTLE | tail -2
            THROTTLE events:        426  ( 9.0%)
          UNTHROTTLE events:        425  ( 9.0%)

$ perf report -D | grep PERF_RECORD_SAMPLE -a4 | tail -n 5
0 1020120874009167 0x74970 [0x68]: PERF_RECORD_SAMPLE(IP, 0x1):
... sample_read:
.... group nr 2
..... id 0000000000000327, value 000000000cbb993a, lost 0
..... id 0000000000000328, value 00000002211c26df, lost 0

The patch set tries to provide a generic fix for the group throttle
support. So the buggy driver-specific implementation can be removed.

The patch set is verified on newer Intel platforms (Kan), ARM (Leo Yan),
and s390 (Thomas Richter).

Kan Liang (16):
  perf: Clean up event in freq mode check
  perf: Fix the throttle logic for a group
  perf/x86/intel: Remove driver-specific throttle support
  perf/x86/amd: Remove driver-specific throttle support
  perf/x86/zhaoxin: Remove driver-specific throttle support
  powerpc/perf: Remove driver-specific throttle support
  s390/perf: Remove driver-specific throttle support
  perf/arm: Remove driver-specific throttle support
  perf/apple_m1: Remove driver-specific throttle support
  alpha/perf: Remove driver-specific throttle support
  arc/perf: Remove driver-specific throttle support
  csky/perf: Remove driver-specific throttle support
  loongarch/perf: Remove driver-specific throttle support
  sparc/perf: Remove driver-specific throttle support
  xtensa/perf: Remove driver-specific throttle support
  mips/perf: Remove driver-specific throttle support

 arch/alpha/kernel/perf_event.c       | 11 ++---
 arch/arc/kernel/perf_event.c         |  6 +--
 arch/csky/kernel/perf_event.c        |  3 +-
 arch/loongarch/kernel/perf_event.c   |  3 +-
 arch/mips/kernel/perf_event_mipsxx.c |  3 +-
 arch/powerpc/perf/core-book3s.c      |  6 +--
 arch/powerpc/perf/core-fsl-emb.c     |  3 +-
 arch/s390/kernel/perf_cpum_cf.c      |  2 -
 arch/s390/kernel/perf_cpum_sf.c      |  5 +-
 arch/sparc/kernel/perf_event.c       |  3 +-
 arch/x86/events/amd/core.c           |  3 +-
 arch/x86/events/amd/ibs.c            |  4 +-
 arch/x86/events/core.c               |  3 +-
 arch/x86/events/intel/core.c         |  6 +--
 arch/x86/events/intel/ds.c           |  7 ++-
 arch/x86/events/intel/knc.c          |  3 +-
 arch/x86/events/intel/p4.c           |  3 +-
 arch/x86/events/zhaoxin/core.c       |  3 +-
 arch/xtensa/kernel/perf_event.c      |  3 +-
 drivers/perf/apple_m1_cpu_pmu.c      |  3 +-
 drivers/perf/arm_pmuv3.c             |  3 +-
 drivers/perf/arm_v6_pmu.c            |  3 +-
 drivers/perf/arm_v7_pmu.c            |  3 +-
 drivers/perf/arm_xscale_pmu.c        |  6 +--
 kernel/events/core.c                 | 73 ++++++++++++++++++++--------
 25 files changed, 84 insertions(+), 87 deletions(-)

-- 
2.38.1


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

end of thread, other threads:[~2025-05-20 20:02 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-16 18:28 [PATCH V3 00/16] perf: Fix the throttle logic for group kan.liang
2025-05-16 18:28 ` [PATCH V3 01/16] perf: Clean up event in freq mode check kan.liang
2025-05-16 18:28 ` [PATCH V3 02/16] perf: Fix the throttle logic for a group kan.liang
2025-05-17  8:22   ` Ingo Molnar
2025-05-20 14:16     ` Liang, Kan
2025-05-18 19:18   ` Namhyung Kim
2025-05-20 14:47     ` Liang, Kan
2025-05-20 20:02       ` Namhyung Kim
2025-05-16 18:28 ` [PATCH V3 03/16] perf/x86/intel: Remove driver-specific throttle support kan.liang
2025-05-16 18:28 ` [PATCH V3 04/16] perf/x86/amd: " kan.liang
2025-05-16 18:28 ` [PATCH V3 05/16] perf/x86/zhaoxin: " kan.liang
2025-05-16 18:28 ` [PATCH V3 06/16] powerpc/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 07/16] s390/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 08/16] perf/arm: " kan.liang
2025-05-16 18:28 ` [PATCH V3 09/16] perf/apple_m1: " kan.liang
2025-05-16 18:28 ` [PATCH V3 10/16] alpha/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 11/16] arc/perf: " kan.liang
2025-05-18 21:58   ` Vineet Gupta
2025-05-16 18:28 ` [PATCH V3 12/16] csky/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 13/16] loongarch/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 14/16] sparc/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 15/16] xtensa/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 16/16] mips/perf: " kan.liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).