diff options
| author | Kaitao Cheng <chengkaitao@kylinos.cn> | 2026-02-14 20:40:39 +0800 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-02-23 17:37:06 -0800 |
| commit | ee9886c40aaeb0fa0817e28d995bb7c58d66ab25 (patch) | |
| tree | 75c1025a2ed6945d4cdb7f2991df36ee8ae223f2 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 964c0747686abda124cf718a91ac1c0c325ca52a (diff) | |
bpf: allow using bpf_kptr_xchg even if the NON_OWN_REF flag is set
When traversing an rbtree using bpf_rbtree_left/right, if bpf_kptr_xchg
is used to access the __kptr pointer contained in a node, it currently
requires first removing the node with bpf_rbtree_remove and clearing the
NON_OWN_REF flag, then re-adding the node to the original rbtree with
bpf_rbtree_add after usage. This process significantly degrades rbtree
traversal performance. The patch enables accessing __kptr pointers with
the NON_OWN_REF flag set while holding the lock, eliminating the need
for this remove-read-add sequence.
Signed-off-by: Kaitao Cheng <chengkaitao@kylinos.cn>
Signed-off-by: Feng Yang <yangfeng@kylinos.cn>
Link: https://lore.kernel.org/r/20260214124042.62229-3-pilgrimtao@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
