mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gabriele Monaco <gmonaco@redhat.com>
To: Yunseong Kim <ysk@kzalloc.com>, Nam Cao <namcao@linutronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	rostedt@goodmis.org,  Tomas Glozar <tglozar@redhat.com>,
	Shung-Hsi Yu <shung-hsi.yu@suse.com>,
	Byungchul Park <byungchul@sk.com>,
		syzkaller@googlegroups.com, linux-rt-devel@lists.linux.dev,
	LKML	 <linux-kernel@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [Question] Detecting Sleep-in-Atomic Context in PREEMPT_RT via RV (Runtime Verification) monitor rtapp:sleep
Date: Tue, 23 Dec 2025 16:21:16 +0100	[thread overview]
Message-ID: <c966b103b002e520f5a4bf80b18835a485cf0cfa.camel@redhat.com> (raw)
In-Reply-To: <92a7c013-0676-4c81-867f-b55c69a1edd6@kzalloc.com>

Hi Yunseong,

> I will also double-check sleepable memory allocations in the context of
> PREEMPT_RT kernels to see if there are other patterns being missed.

You may want to play with lockdep as well, it's much heavier but can catch a lot
of those issues. I believe it still relies on annotations though, so it might
have blind spots too (though it's battle-tested on locks).

> My interest in this arose because I've been seeing these legacy patterns
> consistently reported as bugs in the Real-Time (PREEMPT_RT) kernel. It
> seems many kernel developers are still unaware that these patterns are
> problematic, partly because some older Linux learning materials actually
> recommended them. This makes it quite likely that such code will continue
> to find its way into the upstream.

Yeah that's quite common indeed, I see kernel functions claiming to be atomic
while in fact using (sleeping) spinlocks.

Reading the material Daniel left (RV's original author), he thought of a similar
model, so at least we know there was interest in this kind of thing.


> I will keep looking into more meaningful contributions for RV. For instance,
> I’ve been considering a monitor to detect excessive memory compaction issues
> under specific workloads, which I’ve encountered during kernel development.

Looking forward to knowing more!

Cheers,
Gabriele


  reply	other threads:[~2025-12-23 15:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-27  6:54 Yunseong Kim
2025-10-27 12:20 ` Gabriele Monaco
2025-10-28 22:53   ` Yunseong Kim
2025-10-29  9:24     ` Gabriele Monaco
2025-11-05  9:10 ` Nam Cao
2025-12-02 11:14   ` Nam Cao
2025-12-02 11:26     ` Sebastian Andrzej Siewior
2025-12-11  4:30       ` Yunseong Kim
2025-12-11  5:42         ` Nam Cao
2025-12-11  7:58           ` Yunseong Kim
2025-12-22  7:40             ` Gabriele Monaco
2025-12-23 14:31               ` Yunseong Kim
2025-12-23 15:21                 ` Gabriele Monaco [this message]
2025-12-12  7:02       ` Dan Carpenter

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=c966b103b002e520f5a4bf80b18835a485cf0cfa.camel@redhat.com \
    --to=gmonaco@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=byungchul@sk.com \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=namcao@linutronix.de \
    --cc=rostedt@goodmis.org \
    --cc=shung-hsi.yu@suse.com \
    --cc=syzkaller@googlegroups.com \
    --cc=tglozar@redhat.com \
    --cc=ysk@kzalloc.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

all inboxes | Powered by JetHome®