From: Gabriele Monaco <gmonaco@redhat.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>, wen.yang@linux.dev
Cc: Nam Cao <namcao@linutronix.de>,
linux-trace-kernel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] rv/reactors: fix lockdep "Invalid wait context" in rv_react()
Date: Mon, 06 Jul 2026 16:02:08 +0200 [thread overview]
Message-ID: <3c53f741559f834986e976b524c5ded90bbd5627.camel@redhat.com> (raw)
In-Reply-To: <20260623112942-4943fc6a-c1d5-4eed-a91f-66b3a034caa7@linutronix.de>
On Tue, 2026-06-23 at 11:38 +0200, Thomas Weißschuh wrote:
> This now allows reactors to take (raw) spinlocks. The original idea was
> to not allow that as a reactor can be called from LD_WAIT_FREE context.
> So I am not sure this is the right fix. Not that I have a better one
> available right now.
As far as I understand it, LD_WAIT_FREE is fairly impossible to apply on
preemptible code (here we see it hit by an interrupt).
Since we kind of have to allow raw spinlock to avoid this (even if we don't take
them explicitly), why wouldn't a reactor ever be allowed to take raw spinlocks?
Technically it wouldn't be wrong to take locks from RV monitors, although most
monitors don't do it explicitly.
If we ever happen to take the wrong lock explicitly from a reactor triggered by
a nasty event (e.g. sched_switch), I believe lockdep would still be complaining
down that path, so we probably don't need to be too strict in rv_react().
Obviously we don't want to disable interrutps for LD_WAIT_FREE to hold either.
Am I missing something?
Thanks,
Gabriele
next prev parent reply other threads:[~2026-07-06 14:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 16:44 [PATCH 0/3] rv/reactors: fix lockdep warning and add KUnit tests wen.yang
2026-06-15 16:44 ` [PATCH 1/3] rv/reactors: fix lockdep "Invalid wait context" in rv_react() wen.yang
2026-06-17 11:12 ` Nam Cao
2026-06-17 15:58 ` Nam Cao
2026-06-23 9:38 ` Thomas Weißschuh
2026-07-06 14:02 ` Gabriele Monaco [this message]
2026-06-15 16:44 ` [PATCH 2/3] rv/reactors: add KUnit tests for reactor_printk wen.yang
2026-06-23 9:54 ` Thomas Weißschuh
2026-07-06 14:41 ` Gabriele Monaco
2026-06-15 16:44 ` [PATCH 3/3] rv/reactors: add KUnit tests for reactor_panic wen.yang
2026-06-20 23:30 ` XIAO WU
2026-06-21 3:34 ` Wen Yang
2026-07-06 14:48 ` Gabriele Monaco
2026-07-06 15:00 ` Gabriele Monaco
2026-06-17 15:41 ` [PATCH 0/3] rv/reactors: fix lockdep warning and add KUnit tests Gabriele Monaco
2026-06-17 15:52 ` Nam Cao
2026-06-17 16:14 ` Gabriele Monaco
2026-06-17 17:11 ` Wen Yang
2026-06-18 15:35 ` Gabriele Monaco
2026-06-20 9:13 ` Wen Yang
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=3c53f741559f834986e976b524c5ded90bbd5627.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