[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0d06ce4c-6ff2-401a-90d9-5a4dfd2abebb@kzalloc.com>
Date: Thu, 11 Dec 2025 16:58:55 +0900
From: Yunseong Kim <ysk@...lloc.com>
To: Nam Cao <namcao@...utronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>, rostedt@...dmis.org,
Gabriele Monaco <gmonaco@...hat.com>, Tomas Glozar <tglozar@...hat.com>,
Shung-Hsi Yu <shung-hsi.yu@...e.com>, Byungchul Park <byungchul@...com>,
syzkaller@...glegroups.com, linux-rt-devel@...ts.linux.dev,
LKML <linux-kernel@...r.kernel.org>, Dan Carpenter <dan.carpenter@...aro.org>
Subject: Re: [Question] Detecting Sleep-in-Atomic Context in PREEMPT_RT via RV
(Runtime Verification) monitor rtapp:sleep
Thanks you Nam, for pointing that out!
On 12/11/25 14:42, Nam Cao wrote:
> Yunseong Kim <ysk@...lloc.com> writes:
>> I specifically believe that RV can encompass the role of
>> CONFIG_DEBUG_ATOMIC_SLEEP and even go beyond it.
>>
>> My reasoning is that even if a sleepable (PREEMPT_RT) spinlock is used
>> within an IRQ/preemption disabled section, CONFIG_DEBUG_ATOMIC_SLEEP
>> might not trigger a warning if scheduling does not actually occur (i.e.,
>> if there is no contention for that spinlock). This is because the actual
>> debugging check happens in __might_resched().
>
> That's not how it works. See the description of CONFIG_DEBUG_ATOMIC_SLEEP:
>
> "If you say Y here, various routines which may sleep will become very
> noisy if they are called inside atomic sections: when a spinlock is
> held, inside an rcu read side critical section, inside preempt disabled
> sections, inside an interrupt, etc..."
I am currently considering how to model this to cover cases that go
beyond what CONFIG_DEBUG_ATOMIC_SLEEP covers.
My specific concern is about custom functions where might_sleep() might
be missing. In such cases, if the code hits a fast path (no scheduling),
CONFIG_DEBUG_ATOMIC_SLEEP won't trigger. I'm wondering if RV can detect
these potential bugs.
> Nam
Thanks a lot for the quick reply!
Best regards,
Yunseong Kim
Powered by blists - more mailing lists