On 2026-09-30 21:21:02 [+0200], Karl Mehltretter wrote:
netpoll_send_skb() calls __netpoll_send_skb() with hard interrupts
disabled. When direct transmission cannot complete, the latter queues
the skb with skb_queue_tail(). The sk_buff_head lock may sleep on
PREEMPT_RT:
BUG: sleeping function called from invalid context
in_atomic(): 0, irqs_disabled(): 1, non_block: 0
rt_spin_lock
skb_queue_tail
netpoll_send_skb
How is this possible? netpoll is only used by netconsole right? And this
is CON_NBCON so it only prints threaded. What is the missing piece?
The delayed transmit worker has the same problem when it requeues a busy
skb with skb_queue_head() after disabling interrupts.
Add a dedicated raw spinlock and use the unlocked skb queue helpers under
it. Keep raw critical sections limited to queue operations. During
cleanup, splice the queue to a private list before freeing its skbs.
Fixes: b6cd27ed3388 ("netpoll per device txq")
Cc: stable@vger.kernel.org # 6.12+
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <redacted>
Sebastian