linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V4 00/16] perf: Fix the throttle logic for group
@ 2025-05-20 18:16 kan.liang
  2025-05-20 18:16 ` [PATCH V4 01/16] perf: Fix the throttle logic for a group kan.liang
                   ` (15 more replies)
  0 siblings, 16 replies; 50+ messages in thread
From: kan.liang @ 2025-05-20 18:16 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 V3:
- Add a new patch to only dump the throttle log for the leader
- Apply the perf_event_unthrottle() in event_sched_in() as well
- Not include the cleanup patch since it has been merged
- Add Acked-by from Vineet

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: Fix the throttle logic for a group
  perf: Only dump the throttle log for the leader
  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                 | 68 ++++++++++++++++++++--------
 25 files changed, 79 insertions(+), 87 deletions(-)

-- 
2.38.1


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

end of thread, other threads:[~2025-08-11 14:02 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-20 18:16 [PATCH V4 00/16] perf: Fix the throttle logic for group kan.liang
2025-05-20 18:16 ` [PATCH V4 01/16] perf: Fix the throttle logic for a group kan.liang
2025-05-20 22:02   ` Namhyung Kim
2025-05-21 12:16   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-27 16:16   ` [PATCH V4 01/16] " Leo Yan
2025-05-27 19:30     ` Liang, Kan
2025-05-28 10:28       ` Leo Yan
2025-05-28 14:51         ` Liang, Kan
2025-06-02  0:30   ` perf regression. Was: " Alexei Starovoitov
2025-06-02 12:55     ` Liang, Kan
2025-06-02 16:24       ` Alexei Starovoitov
2025-06-02 17:51         ` Liang, Kan
2025-06-02 18:14           ` Alexei Starovoitov
2025-05-20 18:16 ` [PATCH V4 02/16] perf: Only dump the throttle log for the leader kan.liang
2025-05-20 22:02   ` Namhyung Kim
2025-05-21 12:05   ` Peter Zijlstra
2025-05-21 13:55     ` Liang, Kan
2025-05-21 12:16   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 03/16] perf/x86/intel: Remove driver-specific throttle support kan.liang
2025-05-21 12:16   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 04/16] perf/x86/amd: " kan.liang
2025-05-21 12:16   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 05/16] perf/x86/zhaoxin: " kan.liang
2025-05-21 12:16   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 06/16] powerpc/perf: " kan.liang
2025-05-21 12:16   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 07/16] s390/perf: " kan.liang
2025-05-21 12:15   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-07-23  8:06   ` [PATCH V4 07/16] " Sumanth Korikkar
2025-08-06  8:37     ` Sumanth Korikkar
2025-08-06 17:05       ` Liang, Kan
2025-08-11 14:02         ` Sumanth Korikkar
2025-05-20 18:16 ` [PATCH V4 08/16] perf/arm: " kan.liang
2025-05-21 12:15   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 09/16] perf/apple_m1: " kan.liang
2025-05-21 12:15   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 10/16] alpha/perf: " kan.liang
2025-05-21 12:15   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 11/16] arc/perf: " kan.liang
2025-05-21 12:15   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 12/16] csky/perf: " kan.liang
2025-05-21 12:15   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 13/16] loongarch/perf: " kan.liang
2025-05-21 12:15   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 14/16] sparc/perf: " kan.liang
2025-05-21 12:15   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 15/16] xtensa/perf: " kan.liang
2025-05-21 12:15   ` [tip: perf/core] " tip-bot2 for Kan Liang
2025-05-20 18:16 ` [PATCH V4 16/16] mips/perf: " kan.liang
2025-05-21 12:15   ` [tip: perf/core] " tip-bot2 for 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).