]> git.dujemihanovic.xyz Git - linux.git/commit
uprobes: turn trace_uprobe's nhit counter to be per-CPU one
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 13 Aug 2024 20:34:09 +0000 (13:34 -0700)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Wed, 25 Sep 2024 11:10:38 +0000 (20:10 +0900)
commit10cdb82aa77f313dcfe947a17f7fc12c5affb38e
tree335925a98652d17945f7a3d1c4b6ec49701f31a5
parentda3ea35007d0af457a0afc87e84fddaebc4e0b63
uprobes: turn trace_uprobe's nhit counter to be per-CPU one

trace_uprobe->nhit counter is not incremented atomically, so its value
is questionable in when uprobe is hit on multiple CPUs simultaneously.

Also, doing this shared counter increment across many CPUs causes heavy
cache line bouncing, limiting uprobe/uretprobe performance scaling with
number of CPUs.

Solve both problems by making this a per-CPU counter.

Link: https://lore.kernel.org/all/20240813203409.3985398-1-andrii@kernel.org/
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
kernel/trace/trace_uprobe.c