perf: Fix the throttle logic for group
Status from this message: The following commit has been merged into the perf/core branch of tip:
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest16 patches 17 repliesApplied
- v316 patches 6 repliesApplied
- v215 patches 10 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 RFC | 15 patches | 9 replies | Superseded |
Changes in v4 from the cover letter
- 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
Patches in v4 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/16 | perf: Fix the throttle logic for a groupkernel/ | +46 | 10 replies | |
| 2/16 | perf: Only dump the throttle log for the leaderkernel/ | +4 | 3 replies | |
| 3/16 | perf/x86/intel: Remove driver-specific throttle supportarch/ arch/ arch/ +2 more | +8 | 0 replies | |
| 4/16 | perf/x86/amd: Remove driver-specific throttle supportarch/ arch/ | +2 | 0 replies | |
| 5/16 | perf/x86/zhaoxin: Remove driver-specific throttle supportarch/ | +1 | 0 replies | |
| 6/16 | powerpc/perf: Remove driver-specific throttle supportarch/ arch/ | +3 | 0 replies | |
| 7/16 | s390/perf: Remove driver-specific throttle supportarch/ arch/ | +1 | 4 replies | |
| 8/16 | perf/arm: Remove driver-specific throttle supportdrivers/ drivers/ drivers/ +1 more | +5 | 0 replies | |
| 9/16 | perf/apple_m1: Remove driver-specific throttle supportdrivers/ | +1 | 0 replies | |
| 10/16 | alpha/perf: Remove driver-specific throttle supportarch/ | +3 | 0 replies | |
| 11/16 | arc/perf: Remove driver-specific throttle supportarch/ | +2 | 0 replies | |
| 12/16 | csky/perf: Remove driver-specific throttle supportarch/ | +1 | 0 replies | |
| 13/16 | loongarch/perf: Remove driver-specific throttle supportarch/ | +1 | 0 replies | |
| 14/16 | sparc/perf: Remove driver-specific throttle supportarch/ | +1 | 0 replies | |
| 15/16 | xtensa/perf: Remove driver-specific throttle supportarch/ | +1 | 0 replies | |
| 16/16 | mips/perf: Remove driver-specific throttle supportarch/ | +1 | 0 replies |
Reviews trailers per patch
6 of 16 patches have a Reviewed-by or Acked-by.
| Patch | Ravi Bangoria | Vineet Gupta | Thomas Richter | Leo Yan | Guo Ren | Max Filippov | Namhyung Kim | Alexei Starovoitov | Sumanth Korikkar |
|---|---|---|---|---|---|---|---|---|---|
| 1/16 | A-b | T-b | |||||||
| 2/16 | A-b | ||||||||
| 3/16 | |||||||||
| 4/16 | R-b | ||||||||
| 5/16 | |||||||||
| 6/16 | |||||||||
| 7/16 | T-b | T-b | |||||||
| 8/16 | T-b | ||||||||
| 9/16 | |||||||||
| 10/16 | |||||||||
| 11/16 | A-b | ||||||||
| 12/16 | A-b | ||||||||
| 13/16 | |||||||||
| 14/16 | |||||||||
| 15/16 | R-b | ||||||||
| 16/16 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 9 reviewers.
Cover letter [PATCH V4 00/16] perf: Fix the throttle logic for group
From: Kan Liang <[email protected]>
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/[email protected]/
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(-)
Signature · 1 line
2.38.1