diff options
author | Hao Luo <[email protected]> | 2022-02-23 16:05:31 -0800 |
---|---|---|
committer | Daniel Borkmann <[email protected]> | 2022-02-28 18:10:28 +0100 |
commit | ceac059ed4fd8abc0940f799dd5133275011e244 (patch) | |
tree | 4e729eefc44be098eb1d1c0c3d21db73f8cb3658 /drivers/fpga/fpga-bridge.c | |
parent | a4fbfdd7a160eccaafc093eb5b34f838b1ca0bf0 (diff) |
bpf: Cache the last valid build_id
For binaries that are statically linked, consecutive stack frames are
likely to be in the same VMA and therefore have the same build id.
On a real-world workload, we observed that 66% of CPU cycles in
__bpf_get_stackid() were spent on build_id_parse() and find_vma().
As an optimization for this case, we can cache the previous frame's
VMA, if the new frame has the same VMA as the previous one, reuse the
previous one's build id.
We are holding the MM locks as reader across the entire loop, so we
don't need to worry about VMA going away.
Tested through "stacktrace_build_id" and "stacktrace_build_id_nmi" in
test_progs.
Suggested-by: Greg Thelen <[email protected]>
Signed-off-by: Hao Luo <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Reviewed-by: Pasha Tatashin <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Acked-by: Song Liu <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'drivers/fpga/fpga-bridge.c')
0 files changed, 0 insertions, 0 deletions