selftests/bpf: Fix map_kptr grace period wait
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Wed, 11 Feb 2026 18:57:47 +0000 (10:57 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 13 Feb 2026 22:14:27 +0000 (14:14 -0800)
commit2669dde7a8c67e3efe8052d75d6040de2cbb5e5a
tree36596d06608e02a4c77bc74b18f7372da94c17f0
parent48f624c3dc71c2b807ce138bb70d1f5216532874
selftests/bpf: Fix map_kptr grace period wait

Commit c27cea4416a3 ("rcu: Re-implement RCU Tasks Trace in terms of SRCU-fast")
broke map_kptr selftest since it removed the function we were kprobing.
Use a new kfunc that invokes call_rcu_tasks_trace and sets a program
provided pointer to an integer to 1. Technically this can be unsafe if
the memory being written to from the callback disappears, but this is
just for usage in a test where we ensure we spin until we see the value
to be set to 1, so it's ok.

Reported-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Fixes: c27cea4416a3 ("rcu: Re-implement RCU Tasks Trace in terms of SRCU-fast")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20260211185747.3630539-1-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/map_kptr.c
tools/testing/selftests/bpf/progs/rcu_tasks_trace_gp.c
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
tools/testing/selftests/bpf/test_kmods/bpf_testmod_kfunc.h