diff options
author | Jiri Olsa <jolsa@kernel.org> | 2022-12-15 22:44:30 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-12-19 22:08:37 +0100 |
commit | e2bb9e01d589f7fa82573aedd2765ff9b277816a (patch) | |
tree | 2e4f31e746c2d7efa4abc68daad8030d09166c22 /samples | |
parent | bpf: Do cleanup in bpf_bprintf_cleanup only when needed (diff) | |
download | linux-e2bb9e01d589f7fa82573aedd2765ff9b277816a.tar.xz linux-e2bb9e01d589f7fa82573aedd2765ff9b277816a.zip |
bpf: Remove trace_printk_lock
Both bpf_trace_printk and bpf_trace_vprintk helpers use static buffer guarded
with trace_printk_lock spin lock.
The spin lock contention causes issues with bpf programs attached to
contention_begin tracepoint [1][2].
Andrii suggested we could get rid of the contention by using trylock, but we
could actually get rid of the spinlock completely by using percpu buffers the
same way as for bin_args in bpf_bprintf_prepare function.
Adding new return 'buf' argument to struct bpf_bprintf_data and making
bpf_bprintf_prepare to return also the buffer for printk helpers.
[1] https://lore.kernel.org/bpf/CACkBjsakT_yWxnSWr4r-0TpPvbKm9-OBmVUhJb7hV3hY8fdCkw@mail.gmail.com/
[2] https://lore.kernel.org/bpf/CACkBjsaCsTovQHFfkqJKto6S4Z8d02ud1D7MPESrHa1cVNNTrw@mail.gmail.com/
Reported-by: Hao Sun <sunhao.th@gmail.com>
Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20221215214430.1336195-4-jolsa@kernel.org
Diffstat (limited to 'samples')
0 files changed, 0 insertions, 0 deletions