Mutex wrapper, locking and memory leak fixes
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest posting 2/218 patches 2 repliesIn review
- v4 posting 1/25 of 18 patches 2 repliesSuperseded
- v318 patches 30 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 18 patches | 4 replies | Superseded | |
| v1 | 6 patches | 12 replies | Superseded |
Patches in v4 posting 2/2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | perf mutex: Wrapped usage of mutex and condtools/ tools/ tools/ | +166 | 0 replies | |
| 2/18 | perf bench: Update use of pthread mutex/condtools/ tools/ tools/ +5 more | +153 | 0 replies | |
| 3/18 | perf tests: Avoid pthread.h inclusiontools/ tools/ tools/ | +1 | 0 replies | |
| 4/18 | perf hist: Update use of pthread mutextools/ tools/ tools/ | +9 | 0 replies | |
| 5/18 | perf bpf: Remove unused pthread.h includetools/ | +0 | 0 replies | |
| 6/18 | perf lock: Remove unused pthread.h includetools/ | +0 | 0 replies | |
| 7/18 | perf record: Update use of pthread mutextools/ | +9 | 0 replies | |
| 8/18 | perf sched: Update use of pthread mutextools/ | +32 | 0 replies | |
| 9/18 | perf ui: Update use of pthread mutextools/ tools/ tools/ +5 more | +35 | 0 replies | |
| 10/18 | perf mmap: Remove unnecessary pthread.h includetools/ | +0 | 0 replies | |
| 11/18 | perf dso: Update use of pthread mutextools/ tools/ tools/ | +10 | 0 replies | |
| 12/18 | perf annotate: Update use of pthread mutextools/ tools/ tools/ +1 more | +20 | 0 replies | |
| 13/18 | perf top: Update use of pthread mutextools/ tools/ | +12 | 0 replies | |
| 14/18 | perf dso: Hold lock when accessing nsinfotools/ tools/ tools/ +4 more | +28 | 0 replies | |
| 15/18 | perf mutex: Add thread safety annotationstools/ tools/ | +67 | 0 replies | |
| 16/18 | perf sched: Fixes for thread safety analysistools/ | +29 | 0 replies | |
| 17/18 | perf top: Fixes for thread safety analysistools/ | +3 | 0 replies | |
| 18/18 | perf build: Enable -Wthread-safety with clangtools/ | +5 | 0 replies |
Reviews trailers per patch
None of the 18 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Namhyung Kim |
|---|---|
| Series | A-b |
| 1/18 | |
| 2/18 | |
| 3/18 | |
| 4/18 | |
| 5/18 | |
| 6/18 | |
| 7/18 | |
| 8/18 | |
| 9/18 | |
| 10/18 | |
| 11/18 | |
| 12/18 | |
| 13/18 | |
| 14/18 | |
| 15/18 | |
| 16/18 | |
| 17/18 | |
| 18/18 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 00/18] Mutex wrapper, locking and memory leak fixes
When fixing a locking race and memory leak in:
https://lore.kernel.org/linux-perf-users/[email protected]/
It was requested that debug mutex code be separated out into its own files. This was, in part, done by Pavithra Gurushankar in:
https://lore.kernel.org/lkml/[email protected]/
These patches fix issues with the previous patches, add in the original dso->nsinfo fix and then build on our mutex wrapper with clang's -Wthread-safety analysis. The analysis found missing unlocks in builtin-sched.c which are fixed and -Wthread-safety is enabled by default when building with clang.
v4. Adds a comment for the trylock result, fixes the new line (missed
in v3) and removes two blank lines as suggested by Adrian Hunter.
v3. Adds a missing new line to the error messages and removes the
pshared argument to mutex_init by having two functions, mutex_init and mutex_init_pshared. These changes were suggested by Adrian Hunter.
v2. Breaks apart changes that s/pthread_mutex/mutex/g and the lock
annotations as requested by Arnaldo and Namhyung. A boolean is added to builtin-sched.c to terminate thread funcs rather than leaving them blocked on delted mutexes.
Ian Rogers (17):
perf bench: Update use of pthread mutex/cond
perf tests: Avoid pthread.h inclusion
perf hist: Update use of pthread mutex
perf bpf: Remove unused pthread.h include
perf lock: Remove unused pthread.h include
perf record: Update use of pthread mutex
perf sched: Update use of pthread mutex
perf ui: Update use of pthread mutex
perf mmap: Remove unnecessary pthread.h include
perf dso: Update use of pthread mutex
perf annotate: Update use of pthread mutex
perf top: Update use of pthread mutex
perf dso: Hold lock when accessing nsinfo
perf mutex: Add thread safety annotations
perf sched: Fixes for thread safety analysis
perf top: Fixes for thread safety analysis
perf build: Enable -Wthread-safety with clang
Pavithra Gurushankar (1):
perf mutex: Wrapped usage of mutex and cond
tools/perf/Makefile.config | 5 + tools/perf/bench/epoll-ctl.c | 33 +++--- tools/perf/bench/epoll-wait.c | 33 +++--- tools/perf/bench/futex-hash.c | 33 +++--- tools/perf/bench/futex-lock-pi.c | 33 +++--- tools/perf/bench/futex-requeue.c | 33 +++--- tools/perf/bench/futex-wake-parallel.c | 33 +++--- tools/perf/bench/futex-wake.c | 33 +++--- tools/perf/bench/numa.c | 93 ++++++---------- tools/perf/builtin-inject.c | 4 + tools/perf/builtin-lock.c | 1 - tools/perf/builtin-record.c | 13 ++- tools/perf/builtin-sched.c | 105 +++++++++--------- tools/perf/builtin-top.c | 45 ++++---- tools/perf/tests/mmap-basic.c | 2 - tools/perf/tests/openat-syscall-all-cpus.c | 2 +- tools/perf/tests/perf-record.c | 2 - tools/perf/ui/browser.c | 20 ++-- tools/perf/ui/browsers/annotate.c | 12 +-- tools/perf/ui/setup.c | 5 +- tools/perf/ui/tui/helpline.c | 5 +- tools/perf/ui/tui/progress.c | 8 +- tools/perf/ui/tui/setup.c | 8 +- tools/perf/ui/tui/util.c | 18 ++-- tools/perf/ui/ui.h | 4 +- tools/perf/util/Build | 1 + tools/perf/util/annotate.c | 15 +-- tools/perf/util/annotate.h | 4 +- tools/perf/util/bpf-event.h | 1 - tools/perf/util/build-id.c | 12 ++- tools/perf/util/dso.c | 19 ++-- tools/perf/util/dso.h | 4 +- tools/perf/util/hist.c | 6 +- tools/perf/util/hist.h | 4 +- tools/perf/util/map.c | 3 + tools/perf/util/mmap.h | 1 - tools/perf/util/mutex.c | 119 +++++++++++++++++++++ tools/perf/util/mutex.h | 108 +++++++++++++++++++ tools/perf/util/probe-event.c | 3 + tools/perf/util/symbol.c | 4 +- tools/perf/util/top.h | 5 +- 41 files changed, 569 insertions(+), 323 deletions(-) create mode 100644 tools/perf/util/mutex.c create mode 100644 tools/perf/util/mutex.h
Signature · 1 line
2.37.2.672.g94769d06f0-goog