[bpf-next 6/6] selftests/bpf: Fix arena_spin_lock selftest failure
Alexei Starovoitov
alexei.starovoitov at gmail.com
Sat Aug 9 02:27:01 AEST 2025
On Fri, Aug 8, 2025 at 8:29 AM Saket Kumar Bhaskar <skb99 at linux.ibm.com> wrote:
>
> On Thu, Aug 07, 2025 at 03:21:42PM -0700, Alexei Starovoitov wrote:
> > On Mon, Aug 4, 2025 at 11:29 PM Saket Kumar Bhaskar <skb99 at linux.ibm.com> wrote:
> > >
> > > @@ -60,9 +65,16 @@ static void test_arena_spin_lock_size(int size)
> > > return;
> > > }
> > >
> > > - skel = arena_spin_lock__open_and_load();
> > > - if (!ASSERT_OK_PTR(skel, "arena_spin_lock__open_and_load"))
> > > + skel = arena_spin_lock__open();
> > > + if (!ASSERT_OK_PTR(skel, "arena_spin_lock__open"))
> > > return;
> > > +
> > > + skel->rodata->nr_cpus = get_nprocs();
> >
> > ...
> >
> > > --- a/tools/testing/selftests/bpf/progs/bpf_arena_spin_lock.h
> > > +++ b/tools/testing/selftests/bpf/progs/bpf_arena_spin_lock.h
> > > @@ -20,8 +20,6 @@
> > > #define __arena __attribute__((address_space(1)))
> > > #endif
> > >
> > > -extern unsigned long CONFIG_NR_CPUS __kconfig;
> > > -
> > > /*
> > > * Typically, we'd just rely on the definition in vmlinux.h for qspinlock, but
> > > * PowerPC overrides the definition to define lock->val as u32 instead of
> > > @@ -494,7 +492,7 @@ static __always_inline int arena_spin_lock(arena_spinlock_t __arena *lock)
> > > {
> > > int val = 0;
> > >
> > > - if (CONFIG_NR_CPUS > 1024)
> > > + if (nr_cpus > 1024)
> > > return -EOPNOTSUPP;
> >
> > We cannot do this. It will make arena_spin_lock much harder to use.
> > BPF CI doesn't run on powerpc anyway, but you can document that this
> > test is disable by creating selftests/bpf/DENYLIST.powerpc.
> Hi Alexie,
> Sorry, I did not get it. Can you please help me to understand why it
> makes arena_spin_lock harder to use.
because requiring user space to do
skel->rodata->nr_cpus = get_nprocs()
is a headache.
More information about the Linuxppc-dev
mailing list