Skip to content

perf: Untangle aux refcounting

Alexander Shishkin lkml 1 version In review

Get series with b4
b4 am 1449138762-15194-1-git-send-email-alexander.shishkin@linux.intel.com

Versions newest first

  1. v1 Latest7 patches 20 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7perf: Refuse to begin aux transaction after aux_mmap_count dropskernel/events/ring_buffer.c+7 -00 replies
2/7perf: Generalize task_function_call()ersinclude/linux/perf_event.h kernel/events/core.c+64 -12712 replies
3/7perf: Add a helper to stop running eventskernel/events/core.c+44 -00 replies
4/7perf: Free aux pages in unmap pathkernel/events/core.c kernel/events/internal.h kernel/events/ring_buffer.c+63 -287 replies
5/7perf: Document aux api usagekernel/events/ring_buffer.c+10 -01 reply
6/7perf/x86/intel/pt: Move transaction start/stop to pmu start/stop callbacksarch/x86/kernel/cpu/perf_event_intel_pt.c+27 -580 replies
7/7perf/x86/intel/bts: Move transaction start/stop to start/stop callbacksarch/x86/kernel/cpu/perf_event_intel_bts.c+48 -570 replies

Reviews trailers per patch

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

PatchAlexander Shishkin
1/7
2/7R-b
3/7
4/7
5/7
6/7
7/7

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/7] perf: Untangle aux refcounting

Hi Peter,

As we discussed, here's a patchset that tweaks aux refcounting so that freeing stuff in NMI context is no longer possible. Also, as discussed, I tried to generalize the unlock context - task_function_call - lock context - check stuff - repeat sequence into a helper and converted the existing offenders to use that instead.

I'm not very happy with the way perf_mmap_close turned out, but I figured it's an unmap path and it's at least a start. At some point, a better way of doing things to events on rb::event_list may have to be devised.

For bisectability purposes, it *may* make sense to bring the last two patches forward as they should work just fine with or without the perf_event_stop() trick in mmap_close.

I may have gone slightly over the top with the verbal explanations around what's happening, but at least we won't have to dig up old irc conversations next time it blows up (which it won't do).

Alexander Shishkin (7):
perf: Refuse to begin aux transaction after aux_mmap_count drops
perf: Generalize task_function_call()ers
perf: Add a helper to stop running events
perf: Free aux pages in unmap path
perf: Document aux api usage
perf/x86/intel/pt: Move transaction start/stop to pmu start/stop
callbacks
perf/x86/intel/bts: Move transaction start/stop to start/stop
callbacks

 arch/x86/kernel/cpu/perf_event_intel_bts.c | 105 +++++------
 arch/x86/kernel/cpu/perf_event_intel_pt.c  |  85 +++------
 include/linux/perf_event.h                 |   1 +
 kernel/events/core.c                       | 287 ++++++++++++++++-------------
 kernel/events/internal.h                   |   1 -
 kernel/events/ring_buffer.c                |  52 +++---
 6 files changed, 262 insertions(+), 269 deletions(-)
Signature · 1 line
2.6.2