On Wed, 15 May 2024 at 19:44, Siddharth Chintamaneni <sidchintamaneni@xxxxxxxxx> wrote: > > > CI fails on s390 > > https://github.com/kernel-patches/bpf/actions/runs/9081519831/job/24957489598?pr=7031 > > A different method of triggering deadlock is required. Seems like > > _raw_spin_lock_irqsave being available everywhere cannot be relied > > upon. > > The other functions which are in the critical section are getting > inlined so I have used > _raw_spin_lock_irqsave to write the selftests. > > Other approach could be to just pass the tests if the function is > getting inlined just like in > https://elixir.bootlin.com/linux/latest/source/tools/testing/selftests/bpf/prog_tests/htab_update.c Yeah, it is certainly tricky. Skipping seems fragile because what if x86 and others also inline the function? Then this test would simply report success while not testing anything. One option is to place it at trace_contention_begin, and spawn multiple threads in the test and try until you hit -EBUSY (due to increased contention, leading to queued_spin_lock_slowpath being called and the tracepoint being hit). The other option would be to add a dummy empty call within the critical section marked as noinline, and then attach the BPF program there. But I think this might not be liked by everyone since we're introducing code in the kernel just to test stuff. So option 1 seems better to me, but the test needs to be set up carefully to ensure contention occurs. Others can chime in with better ideas.