Skip to content

Thread memory improvements and fixes

Ian Rogers linux-perf-users lkml 4 versions – Applied

Status from this message: Applied to perf-tools-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 2 repliesApplied
  2. v37 patches 2 repliesSuperseded
  3. v26 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches28 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/7perf report: Sort child tasks by tidtools/perf/builtin-report.c tools/perf/util/machine.c tools/perf/util/machine.h+168 -890 replies
2/7perf trace: Ignore thread hashing in summarytools/perf/builtin-trace.c tools/perf/util/rb_resort.h+23 -230 replies
3/7perf machine: Move fprintf to for_each loop and a callbacktools/perf/util/machine.c+27 -160 replies
4/7perf machine: Move machine's threads into its own abstractiontools/perf/util/bpf_lock_contention.c tools/perf/util/machine.c tools/perf/util/machine.h +2 more+243 -2030 replies
5/7perf threads: Move threads to its own filestools/perf/util/Build tools/perf/util/machine.c tools/perf/util/machine.h +2 more+285 -2730 replies
6/7perf threads: Switch from rbtree to hashmaptools/perf/util/threads.c tools/perf/util/threads.h+47 -1050 replies
7/7perf threads: Reduce table size from 256 to 8tools/perf/util/threads.h+1 -10 replies

Reviews trailers per patch

None of the 7 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNamhyung Kim
SeriesA-b
1/7
2/7
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 v4 thread

Cover letter [PATCH v4 0/7] Thread memory improvements and fixes

The next 6 patches (now 7) from:
https://lore.kernel.org/lkml/[email protected]/
now the initial maps fixes have landed:
https://lore.kernel.org/all/[email protected]/

Separate out and reimplement threads to use a hashmap for lower memory consumption and faster look up. The fixes a regression in memory usage where reference count checking switched to using non-invasive tree nodes. Reduce threads default size by 32 times and improve locking discipline. Also, fix regressions where tids had become unordered to make perf report --tasks and perf trace --summary output easier to read.

v4. Add read lock to threads__for_each_thread, Namhyung. v3. Factor threads out of machine in 1 patch, then move threads
functions in a second.
v2: improve comments and a commit message.

Ian Rogers (7):
perf report: Sort child tasks by tid
perf trace: Ignore thread hashing in summary
perf machine: Move fprintf to for_each loop and a callback perf machine: Move machine's threads into its own abstraction perf threads: Move threads to its own files
perf threads: Switch from rbtree to hashmap
perf threads: Reduce table size from 256 to 8

 tools/perf/builtin-report.c           | 217 +++++++++-------
 tools/perf/builtin-trace.c            |  41 ++--
 tools/perf/util/Build                 |   1 +
 tools/perf/util/bpf_lock_contention.c |   4 +-
 tools/perf/util/machine.c             | 341 +++++++-------------------
 tools/perf/util/machine.h             |  30 +--
 tools/perf/util/rb_resort.h           |   5 -
 tools/perf/util/thread.c              |   2 +-
 tools/perf/util/thread.h              |   6 -
 tools/perf/util/threads.c             | 190 ++++++++++++++
 tools/perf/util/threads.h             |  35 +++
 11 files changed, 478 insertions(+), 394 deletions(-)
 create mode 100644 tools/perf/util/threads.c
 create mode 100644 tools/perf/util/threads.h
Signature · 1 line
2.44.0.278.ge034bb2e1d-goog