[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <c15a819a-51de-467c-93fd-c321dd2e8ec9@kzalloc.com>
Date: Tue, 19 Aug 2025 01:56:00 +0900
From: Yunseong Kim <ysk@...lloc.com>
To: Johannes Berg <johannes.berg@...el.com>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Clark Williams <clrkwllms@...nel.org>, Steven Rostedt <rostedt@...dmis.org>,
Jiri Kosina <jkosina@...e.cz>, Aaron Hill <aa1ronham@...il.com>,
Lukas Redlinger <rel+kernel@...lox.net>, Oleksii Shevchuk
<alxchk@...il.com>, Toke Høiland-Jørgensen
<toke@...hat.com>, linux-wireless@...r.kernel.org,
linux-rt-devel@...ts.linux.dev, LKML <linux-kernel@...r.kernel.org>
Subject: [RFC] mac80211: Potential sleep in atomic context in
__ieee80211_wake_txqs
Hi,
I found a potential PREEMPT_RT issue I noticed in __ieee80211_wake_txqs()
static void __ieee80211_wake_txqs(struct ieee80211_sub_if_data *sdata, int ac)
{
...
local_bh_disable();
spin_lock(&fq->lock);
...
}
This sequence of local_bh_disable() followed by spin_lock(). On an
RT-enabled system, spin_lock() is converted to a sleeping lock. Calling it
immediately after local_bh_disable() creates a situation where a sleeping
function is called from an atomic context, which will lead to a sleep in
atomic context if the lock is contended.
The conventional fix for this pattern is to replace the two lines with a
single, RT-safe call to spin_lock_bh(&fq->lock).
I wanted to bring this up for discussion before preparing a patch. Is this
a valid concern, and would a patch to correct this locking be the right
approach?
Thank you for your time and consideration.
Best regards,
Yunseong Kim
Powered by blists - more mailing lists