]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf env: Add mutex to protect lazy environment initialization
authorIan Rogers <irogers@google.com>
Tue, 2 Jun 2026 15:25:13 +0000 (08:25 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 3 Jun 2026 19:52:49 +0000 (16:52 -0300)
commit0ff9718c266f9eb334674377501ccf37d8d351a4
treece196e8d76e9e5e8dcc4fdc9fc0bcf0c438425af
parentda976dd4842981fa9fe8bf736ec3d440fa9ce029
perf env: Add mutex to protect lazy environment initialization

Introduce a mutex to 'struct perf_env' to safely protect lazy
metadata setup, such as os_release or e_machine resolution,
preventing concurrent initialization data races and memory leaks
during multi-threaded profiling or symbol loading.

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Honglei Wang <jameshongleiwang@126.com>
Cc: Jan Polensky <japo@linux.ibm.com>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/env.c
tools/perf/util/env.h