[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250819100756.IpUQx4jh@linutronix.de>
Date: Tue, 19 Aug 2025 12:07:56 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Yunseong Kim <ysk@...lloc.com>
Cc: Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Florian Westphal <fw@...len.de>,
Clark Williams <clrkwllms@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
LKML <linux-kernel@...r.kernel.org>, linux-rt-devel@...ts.linux.dev,
netdev@...r.kernel.org
Subject: Re: [RFC] net: inet: Potential sleep in atomic context in
inet_twsk_hashdance_schedule on PREEMPT_RT
On 2025-08-19 01:46:10 [+0900], Yunseong Kim wrote:
> Hi everyone,
Hi,
> {
> ...
> local_bh_disable();
> spin_lock(&bhead->lock);
> spin_lock(&bhead2->lock);
> ...
> }
>
> The sequence local_bh_disable() followed by spin_lock(), In a PREEMPT_RT
> enabled kernel, spin_lock() is replaced by a mutex that an sleep.
> However, local_bh_disable() creates an atomic context by incrementing
> preempt_count, where sleeping is forbidden.
As Eric said, the mentioned pattern is common and not problematic.
The wrong assumption here is that local_bh_disable() on PREEMPT_RT
"creates an atomic context by incrementing preempt_count, where sleeping
is forbidden". This is simply not the case.
> Best regards,
> Yunseong Kim
Sebastian
Powered by blists - more mailing lists