From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Daniel Vacek <neelx@suse.com>
Cc: edumazet@google.com, kuba@kernel.org,
linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev,
netdev@vger.kernel.org, spasswolf@web.de, tglx@linutronix.de
Subject: Re: "Dead loop on virtual device" error without softirq-BKL on PREEMPT_RT
Date: Wed, 18 Mar 2026 15:51:01 +0100 [thread overview]
Message-ID: <20260318145101._iaDDpbE@linutronix.de> (raw)
In-Reply-To: <CAPjX3FcRYNkYK2gerbRL4C9wXZPxWSs6=oTjzv5+msm4PQrfqA@mail.gmail.com>
On 2026-03-18 15:43:52 [+0100], Daniel Vacek wrote:
> On Wed, 18 Mar 2026 at 12:18, Sebastian Andrzej Siewior
> <bigeasy@linutronix.de> wrote:
> >
> > On 2026-03-18 11:30:09 [+0100], Daniel Vacek wrote:
> > > > --- a/net/core/dev.c
> > > > +++ b/net/core/dev.c
> > > > @@ -4821,7 +4821,7 @@ int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)
> > > > /* Other cpus might concurrently change txq->xmit_lock_owner
> > > > * to -1 or to their cpu id, but not to our id.
> > > > */
> > > > - if (READ_ONCE(txq->xmit_lock_owner) != cpu) {
> > > > + if (rt_mutex_owner(&txq->_xmit_lock.lock) != current) {
> > >
> > > Ain't this changing the behavior for !RT case? Previously, if it was the same thread
> > > which has already locked the queue (and hence the same CPU) evaluating this condition,
> > > the condition was skipped, which is no longer the case with this change.
> >
> > The above was me thinking and does not even compile for !RT. Commit
> > b824c3e16c190 ("net: Provide a PREEMPT_RT specific check for
> > netdev_queue::_xmit_lock") is what was merged in the end.
>
> Hmm, that means txq->xmit_lock_owner is not used at all for PREEMT_RT.
> It's pointless to even store it. Shall we care?
For PREEMPT_RT the xmit_lock_owner member is only stored and not used
otherwise. It could be removed as in ifdef-ed away but I do not care
enough to sprinkle it and the gain is little (proof me wrong). So I am
happy as-is.
As for the check itself as we have now, we detect the deadlock before it
happens and this is nice to have. The alternative (in case of a
deadlock) would be the deadlock detection in rtmutex code which would
freeze the thread.
> --nX
>
Sebastian
next prev parent reply other threads:[~2026-03-18 14:51 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 13:43 "Dead loop on virtual device" error without softirq-BKL on PREEMPT_RT Bert Karwatzki
2026-02-16 15:32 ` Bert Karwatzki
2026-02-16 15:37 ` Sebastian Andrzej Siewior
2026-02-16 23:48 ` Bert Karwatzki
2026-02-17 7:19 ` Sebastian Andrzej Siewior
2026-02-17 8:56 ` Bert Karwatzki
2026-02-17 9:57 ` Sebastian Andrzej Siewior
2026-02-17 10:42 ` Bert Karwatzki
2026-02-17 11:24 ` Bert Karwatzki
2026-02-17 16:52 ` Bert Karwatzki
2026-02-17 19:10 ` Bert Karwatzki
2026-02-18 7:30 ` Sebastian Andrzej Siewior
2026-02-18 12:50 ` Bert Karwatzki
2026-02-26 17:29 ` Sebastian Andrzej Siewior
2026-03-18 10:30 ` Daniel Vacek
2026-03-18 11:18 ` Sebastian Andrzej Siewior
2026-03-18 14:43 ` Daniel Vacek
2026-03-18 14:51 ` Sebastian Andrzej Siewior [this message]
2026-03-18 14:58 ` Daniel Vacek
2026-04-01 16:55 ` Daniel Vacek
2026-04-02 7:03 ` Sebastian Andrzej Siewior
2026-04-02 7:50 ` Daniel Vacek
2026-04-02 8:31 ` Sebastian Andrzej Siewior
2026-04-02 9:21 ` Daniel Vacek
2026-04-02 13:46 ` Sebastian Andrzej Siewior
2026-04-02 13:58 ` Daniel Vacek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260318145101._iaDDpbE@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=neelx@suse.com \
--cc=netdev@vger.kernel.org \
--cc=spasswolf@web.de \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.