summaryrefslogtreecommitdiff
path: root/ipc/compat.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2023-06-15 07:07:15 +0300
committerNamhyung Kim <namhyung@kernel.org>2023-06-21 03:04:21 +0300
commit2e9f9d4a729f12b4bc3fa60406374327b1809abe (patch)
tree62b67e9e0f97568569251c7f72f25c40c65d5634 /ipc/compat.c
parent0650b2b2e62edfa9510ba0c80f42d98c4a748b12 (diff)
downloadlinux-2e9f9d4a729f12b4bc3fa60406374327b1809abe.tar.xz
perf annotation: Switch lock from a mutex to a sharded_mutex
Remove the "struct mutex lock" variable from annotation that is allocated per symbol. This removes in the region of 40 bytes per symbol allocation. Use a sharded mutex where the number of shards is set to the number of CPUs. Assuming good hashing of the annotation (done based on the pointer), this means in order to contend there needs to be more threads than CPUs, which is not currently true in any perf command. Were contention an issue it is straightforward to increase the number of shards in the mutex. On my Debian/glibc based machine, this reduces the size of struct annotation from 136 bytes to 96 bytes, or nearly 30%. Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Andres Freund <andres@anarazel.de> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Yuan Can <yuancan@huawei.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Link: https://lore.kernel.org/r/20230615040715.2064350-2-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'ipc/compat.c')
0 files changed, 0 insertions, 0 deletions