linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/6] Mutex wrapper, locking and memory leak fixes
@ 2022-08-17  5:39 Ian Rogers
  2022-08-17  5:39 ` [PATCH v1 1/6] perf mutex: Wrapped usage of mutex and cond Ian Rogers
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Ian Rogers @ 2022-08-17  5:39 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Thomas Gleixner, Darren Hart, Davidlohr Bueso,
	André Almeida, Nathan Chancellor, Nick Desaulniers, Tom Rix,
	Athira Rajeev, Weiguo Li, Pavithra Gurushankar, Thomas Richter,
	Ravi Bangoria, Dario Petrillo, Wenyu Liu, Hewenliang, yaowenbin,
	Dave Marchevsky, Andrii Nakryiko, Alexandre Truong, Kim Phillips,
	Leo Yan, Quentin Monnet, William Cohen, Andres Freund, Song Liu,
	Adrian Hunter, Martin Liška, Colin Ian King, James Clark,
	Fangrui Song, Stephane Eranian, Kajol Jain, Andi Kleen,
	Alexey Bayduraev, Riccardo Mancini, Masami Hiramatsu,
	Christophe JAILLET, Zechuan Chen, Jason Wang, Lexi Shao,
	Remi Bernon, linux-kernel, linux-perf-users, llvm
  Cc: Ian Rogers

When fixing a locking race and memory leak in:
https://lore.kernel.org/linux-perf-users/20211118193714.2293728-1-irogers@google.com/

It was requested that debug mutex code be separated out into its own
files. This was done by Pavithra Gurushankar in:
https://lore.kernel.org/lkml/20220727111954.105118-1-gpavithrasha@gmail.com/

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.

Ian Rogers (4):
  perf dso: Hold lock when accessing nsinfo
  perf mutex: Add thread safety annotations
  perf mutex: Fix thread safety analysis
  perf build: Enable -Wthread-safety with clang

Pavithra Gurushankar (2):
  perf mutex: Wrapped usage of mutex and cond
  perf mutex: Update use of pthread mutex/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                 |  75 ++++++++-------
 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                    |  99 +++++++++++++++++++
 tools/perf/util/mutex.h                    | 105 +++++++++++++++++++++
 tools/perf/util/probe-event.c              |   3 +
 tools/perf/util/symbol.c                   |   4 +-
 tools/perf/util/top.h                      |   5 +-
 41 files changed, 529 insertions(+), 310 deletions(-)
 create mode 100644 tools/perf/util/mutex.c
 create mode 100644 tools/perf/util/mutex.h

-- 
2.37.1.595.g718a3a8f04-goog


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-08-19  6:42 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-17  5:39 [PATCH v1 0/6] Mutex wrapper, locking and memory leak fixes Ian Rogers
2022-08-17  5:39 ` [PATCH v1 1/6] perf mutex: Wrapped usage of mutex and cond Ian Rogers
2022-08-17  5:39 ` [PATCH v1 2/6] perf mutex: Update use of pthread mutex/cond Ian Rogers
2022-08-17 11:54   ` Arnaldo Carvalho de Melo
2022-08-17 13:16     ` Ian Rogers
2022-08-17 13:50       ` Arnaldo Carvalho de Melo
2022-08-17 18:49       ` Arnaldo Carvalho de Melo
2022-08-17 20:42         ` Ian Rogers
2022-08-17  5:39 ` [PATCH v1 3/6] perf dso: Hold lock when accessing nsinfo Ian Rogers
2022-08-17  5:39 ` [PATCH v1 4/6] perf mutex: Add thread safety annotations Ian Rogers
2022-08-17  5:39 ` [PATCH v1 5/6] perf mutex: Fix thread safety analysis Ian Rogers
2022-08-18 16:41   ` Namhyung Kim
2022-08-18 18:17     ` Ian Rogers
2022-08-19  6:42       ` Namhyung Kim
2022-08-17  5:39 ` [PATCH v1 6/6] perf build: Enable -Wthread-safety with clang Ian Rogers
2022-08-18  6:11   ` Namhyung Kim
2022-08-18 13:17     ` Ian Rogers
2022-08-18 15:59       ` Namhyung Kim
2022-08-18 16:20         ` Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).