Linux Trace Kernel
 help / color / mirror / Atom feed
From: Gabriele Monaco <gmonaco@redhat.com>
To: Nam Cao <namcao@linutronix.de>, wen.yang@linux.dev
Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Subject: Re: [PATCH v3 1/4] rv/reactors: use context-sensitive lockdep wait type in rv_react()
Date: Wed, 19 Aug 2026 09:12:43 +0200	[thread overview]
Message-ID: <b6de8228ee3045104a03ab4754e5ecc50e67f627.camel@redhat.com> (raw)
In-Reply-To: <87zeylnos3.fsf@yellow.woof>

On Mon, 2026-08-17 at 10:18 +0200, Nam Cao wrote:
> Gabriele Monaco <gmonaco@redhat.com> writes:
> 
> > On Mon, 2026-08-10 at 01:10 +0800, wen.yang@linux.dev wrote:
> > > From: Wen Yang <wen.yang@linux.dev>
> > > 
> > > Reactors must not explicitly take locks, so they should comply with
> > > LD_WAIT_FREE.  However, reactor callbacks can run with preemption
> > > enabled on any kernel (not just PREEMPT_RT).  If a timer interrupt
> > > fires during the callback, the interrupt exit path schedules and
> > > acquires rq->__lock (LD_WAIT_SPIN) while the lockdep override map that
> > > declared LD_WAIT_FREE is still held, triggering a spurious
> > > "Invalid wait context" warning:
> ...
> > Anyway, I'd appreciate comments/acks from the other folks in the loop
> 
> Sorry, I do not know enough about lockdep to comment on this.
> 
> FWIW, I would rather just use LD_WAIT_SPIN and keep things
> simple. Context-sensitive code paths "feels wrong" to me. Spinning
> should either be allowed or forbidden. Making it dynamic "feels like" it
> will bring further complications down the road.
> 
> But that's just my intuition.

I don't have a strong opinion on this, but since there's no one in the kernel
using LD_WAIT_FREE as inner type, that feels like a hint to go down the simple
route too and allow LD_WAIT_SPIN.

If a reactor ever uses spinlocks, lockdep would already complain on its own if
that ends up being an issue, wouldn't it?

Gabriele


  reply	other threads:[~2026-08-19  7:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-09 17:10 [PATCH v3 0/4] rv/reactors: fix lockdep warning and add KUnit tests wen.yang
2026-08-09 17:10 ` [PATCH v3 1/4] rv/reactors: use context-sensitive lockdep wait type in rv_react() wen.yang
2026-08-12 12:34   ` Gabriele Monaco
2026-08-17  8:18     ` Nam Cao
2026-08-19  7:12       ` Gabriele Monaco [this message]
2026-08-19  9:24         ` Thomas Weißschuh
2026-08-09 17:10 ` [PATCH v3 2/4] rv/reactors: propagate rv_register_reactor() error from reactor init wen.yang
2026-08-17 10:54   ` Nam Cao
2026-08-09 17:10 ` [PATCH v3 3/4] rv/reactors: export rv_register_reactor() and rv_unregister_reactor() wen.yang
2026-08-09 17:10 ` [PATCH v3 4/4] rv/reactors: add KUnit tests for reactor registration and dispatch wen.yang
2026-08-12 12:58   ` Gabriele Monaco
2026-08-17 10:52   ` Nam Cao
2026-08-17 11:05     ` Gabriele Monaco

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=b6de8228ee3045104a03ab4754e5ecc50e67f627.camel@redhat.com \
    --to=gmonaco@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=namcao@linutronix.de \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=wen.yang@linux.dev \
    /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