diff options
| author | 2026-10-06 16:57:26 +0200 | |
|---|---|---|
| committer | 2026-10-07 11:40:29 +0200 | |
| commit | 3f881d589c7d0319de210882cc87de3e0413f620 (patch) | |
| tree | f52b712ff10ef6b61b275c65ff0d33d361a3941c /scripts/Makefile.thinlto | |
| parent | perf mutex: Add DO_ONCE() for one-time initialization (diff) | |
perf config: Serialize config file access with a mutex
Config file access shares the static parser state and, since
perf_config__set_variable() became an entry point for background
features, can run on more than one thread: a feature writing the
config while perf top's display thread reads it. Serialize parsing
and rewriting with config_mutex and the whole read-modify-write of
perf_config__set_variable() with config_update_mutex; config_set_mutex
comes before it, as building the set parses the config files.
perf has its own mutex type, util/mutex.h; the file scope mutexes
here use the DEFINE_MUTEX() static initializer added in the previous
patch. The two lazy inits that system_path() and home_perfconfig()
do would leak all but one of the strings racing on two threads, so
they move to DO_ONCE(), added in the previous patch as well.
bad_config() runs on the dispatching thread, outside config_mutex, so
it stops reading config_file_name, which the parsing thread owns.
Assisted-by: LLM
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
