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
Sebastian Andrzej Siewior
maintainerQuoted 1 line · Yunseong Kim
Hi,
Hi,
Quoted 11 lines
I found a potential
PREEMPT_RTissue 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 byspin_lock(). On an
As explained in the previous mail regarding forinet_twsk_hashdance_schedule(), this is fine.
Quoted 2 lines
Best regards,
Yunseong Kim
Sebastian