Re: [PATCH net v2 1/2] netpoll: use a raw lock for the deferred transmit queue

From: Sebastian Andrzej Siewior

Date: Thu Oct 01 2026 - 03:48:33 EST


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@xxxxxxxxxxxxxxx # 6.12+
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>

Sebastian