Re: [PATCH bpf-next v1 7/8] selftests/bpf: Add selftests for load-acquire and store-release instructions
From: Peilin Ye
Date: Mon Feb 03 2025 - 19:30:56 EST
Hi Eduard,
One more question (for my understanding):
On Tue, Jan 28, 2025 at 05:06:03PM -0800, Eduard Zingerman wrote:
> On Sat, 2025-01-25 at 02:19 +0000, Peilin Ye wrote:
> > --- a/tools/testing/selftests/bpf/progs/arena_atomics.c
> > +++ b/tools/testing/selftests/bpf/progs/arena_atomics.c
> [...]
>
> > +SEC("raw_tp/sys_enter")
> > +int load_acquire(const void *ctx)
> > +{
> > + if (pid != (bpf_get_current_pid_tgid() >> 32))
> > + return 0;
>
> Nit: This check is not needed, since bpf_prog_test_run_opts() is used
> to run the tests.
Could you explain a bit more why it's not needed?
I read commit 0f4feacc9155 ("selftests/bpf: Adding pid filtering for
atomics test") which added those 'pid' checks to atomics/ tests. The
commit message [1] says the purpose was to "make atomics test able to
run in parallel with other tests", which I couldn't understand.
How using bpf_prog_test_run_opts() makes those 'pid' checks unnecessary?
[1] https://lore.kernel.org/bpf/20211006185619.364369-11-fallentree@xxxxxx/#r
Thanks,
Peilin Ye