BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Amery Hung <ameryhung@gmail.com>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	 Martin KaFai Lau <martin.lau@kernel.org>,
	kkd@meta.com, kernel-team@meta.com
Subject: Re: [PATCH bpf-next v1] selftests/bpf: Add ABBCCA case for rqspinlock stress test
Date: Fri, 24 Oct 2025 09:49:19 -0700	[thread overview]
Message-ID: <31a2e1d259485c8d6ae0fa33801e94057f4b47c5.camel@gmail.com> (raw)
In-Reply-To: <CAMB2axOs7-0=BX5HVwYgvGzDu7z2k7UrnNAopCJ_Fq6Vjj8seg@mail.gmail.com>

On Fri, 2025-10-24 at 09:42 -0700, Amery Hung wrote:
> On Wed, Oct 22, 2025 at 3:04 PM Eduard Zingerman <eddyz87@gmail.com> wrote:
> > 
> > On Wed, 2025-10-22 at 17:54 +0000, Kumar Kartikeya Dwivedi wrote:
> > > Introduce a new mode for the rqspinlock stress test that exercises a
> > > deadlock that won't be detected by the AA and ABBA checks, such that we
> > > always reliably trigger the timeout fallback. We need 4 CPUs for this
> > > particular case, as CPU 0 is untouched, and three participant CPUs for
> > > triggering the ABBCCA case.
> > > 
> > > Refactor the lock acquisition paths in the module to better reflect the
> > > three modes and choose the right lock depending on the context.
> > > 
> > > Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
> > > ---
> > 
> > The overhaul makes sense to me and the code is easy to follow.
> > The only nit I have is that test does not fail if deadlock is not detected.
> > E.g. if I remove raw_res_spin_unlock_irqrestore() call in nmi_cb(),
> > there are stall splats in dmesg, but test harness reports success.
> > I suggest adding some signal that all kthreads terminated successfully.
> > 
> > Acked-by: Eduard Zingerman <eddyz87@gmail.com>
> > 
> 
> Maybe it should be another way around? The test must and should have
> triggered deadlocks, so if we count how many times the return of
> raw_res_spin_lock_irqrestore == -EDEADLK or -EITMEDOUT, the number
> should be non-zero.

+1, that would be a good thing to check.

> 
> The test looks good to me otherwise.
> 
> Reviewed-by: Amery Hung <ameryhung@gmail.com>

      reply	other threads:[~2025-10-24 16:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 17:54 [PATCH bpf-next v1] selftests/bpf: Add ABBCCA case for rqspinlock stress test Kumar Kartikeya Dwivedi
2025-10-22 22:04 ` Eduard Zingerman
2025-10-24 16:42   ` Amery Hung
2025-10-24 16:49     ` Eduard Zingerman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31a2e1d259485c8d6ae0fa33801e94057f4b47c5.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=ameryhung@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@meta.com \
    --cc=kkd@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=memxor@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox