Re: "Dead loop on virtual device" error without softirq-BKL on PREEMPT_RT

From: Bert Karwatzki

Date: Wed Feb 18 2026 - 07:51:39 EST


Am Mittwoch, dem 18.02.2026 um 08:30 +0100 schrieb Sebastian Andrzej Siewior:
> On 2026-02-17 20:10:09 [+0100], Bert Karwatzki wrote:
> >
> > I tried to research the original commit which introduced the xmit_lock_owner check, but
> > it is present since linux 2.3.6 (released 19990610) (when __dev_queue_xmit() was still called dev_queue_xmit()),
> > so I can't tell the original idea behind that check (perhaps recuesion detection ...), so I'm
> > not completely sure if it can be omitted (and just let dev_xmit_recursion() do the recursion checking).
>
> Okay. Thank you. I add it to my list.
>
I've thought about it again and I now think the xmit_lock_owner check IS necessary to
avoid deadlocks on recursion in the non-RT case.

My idea to use get_current()->tgid as lock owner also does not work as interrupts are still enabled
and __dev_queue_xmit() can be called from interrupt context. So in a situation where an interrupt occurs
after the lock has been taken and the interrupt handler calls __dev_queue_xmit() on the same CPU a deadlock
would occur.

Bert Karwatzki