Skip to content

perf: Reduce stack usage (and misc bits)

Peter Zijlstra lkml 1 version Applied

Status from this message: The following commit has been merged into the perf/urgent branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 10 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6perf: Reduce stack usage of perf_output_begin()arch/powerpc/perf/imc-pmu.c arch/s390/kernel/perf_cpum_sf.c arch/x86/events/intel/ds.c +3 more+37 -300 replies
2/6perf/x86: Reduce stack usage for x86_pmu::drain_pebs()arch/x86/events/intel/core.c arch/x86/events/intel/ds.c arch/x86/events/perf_event.h+27 -240 replies
3/6perf: Fix get_recursion_context()kernel/events/internal.h+1 -10 replies
4/6perf: Optimize get_recursion_context()kernel/events/internal.h+8 -910 replies
5/6perf/arch: Remove perf_sample_data::regs_user_copyarch/arm/kernel/perf_regs.c arch/arm64/kernel/perf_regs.c arch/csky/kernel/perf_regs.c +7 more+22 -310 replies
6/6perf/x86: Make dummy_iregs staticarch/x86/events/intel/ds.c+1 -10 replies

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by.

PatchSteven RostedtJesper Dangaard Brouer
1/6
2/6
3/6
4/6A-b
5/6T-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] perf: Reduce stack usage (and misc bits)

Hi,

Steve reported an NMI stack overflow when running perf and function tracing together. Thomas found that we had 4 copies of struct perf_sample_data on-stack.

These here patches reduce that to 2 copies and half the size of it.

So just for perf_sample_data we go from 4*384=1536 to 2*192=384 bytes of stack. Also remove one struct pt_regs instance from __intel_pmu_pebs_event(); it has another instance in struct x86_perf_regs which I haven't yet managed to offload.

Perf seems to still work... :-)