]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf lock contention: Reject more than 10ms delays for safety
authorNamhyung Kim <namhyung@kernel.org>
Thu, 15 May 2025 18:10:42 +0000 (11:10 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 31 May 2025 11:45:24 +0000 (08:45 -0300)
commit0df14c1f1ed530ba21b603a2e282589c034367da
tree4a24285744a1a9f95bdeb47f0ccc18df6aa9149b
parent8c56bfe53bd881c7b598c54a3a06216743c57bbc
perf lock contention: Reject more than 10ms delays for safety

Delaying kernel operations can be dangerous and the kernel may kill
(non-sleepable) BPF programs running for long in the future.

Limit the max delay to 10ms and update the document about it.

  $ sudo ./perf lock con -abl -J 100000us@cgroup_mutex true
  lock delay is too long: 100000us (> 10ms)

   Usage: perf lock contention [<options>]

      -J, --inject-delay <TIME@FUNC>
                            Inject delays to specific locks

Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20250515181042.555189-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-lock.txt
tools/perf/builtin-lock.c