From: Antonio Quartulli <antonio@openvpn.net>
To: Dao Zhong Ma <cz1346219@gmail.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: sd@queasysnail.net, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
Ralf Lici <ralf@mandelbit.com>
Subject: Re: [PATCH 1/1] ovpn: tcp - defer TX from softirq to workqueue
Date: Sun, 3 May 2026 23:14:48 +0200 [thread overview]
Message-ID: <b359d13d-8414-4aeb-958c-496b4b898b93@openvpn.net> (raw)
In-Reply-To: <20260501145425.757147-2-cz1346219@gmail.com>
Hi,
On 01/05/2026 16:54, Dao Zhong Ma wrote:
> ovpn_tcp_send_skb() holds sk->sk_lock.slock while performing the full TCP
> send in softirq context. This can hold the spinlock for a long time
> (large skb), blocking lock_sock() users. This can starve the RCU GP
Are you sure that the stall is triggered by just processing 1 large skb?
> kthread and trigger RCU stalls warnings and hung tasks.
Can you trigger the stall/warning easily?
Any steps to reproduce?
>
> Defer the TCP send operation to process context:
> - In interrupt context, only enqueue the skb under the spinlock
> schedule tcp_tx_work.
> - In process context, dequeue and flush the send queue under lock_sock()
>
> This reduces the softirq critical section to a short duration, allowing
> lock_sock() users to make progress and preventing RCU stalls.
>
> Signed-off-by: Dao Zhong Ma <cz1346219@gmail.com>
As Jakub pointed out, this is breaking the selftests, therefore you
should first double check what's going wrong.
On top of that, could you please run some performance tests? I think
this is going to hit quite a penalty.
Especially if you have multiple peers and you defer all their traffic to
the same workqueue.
Regards,
--
Antonio Quartulli
OpenVPN Inc.
prev parent reply other threads:[~2026-05-03 21:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-01 14:54 [PATCH 0/1] ovpn: tcp - defer TX from softirq to workqueue Dao Zhong Ma
2026-05-01 14:54 ` [PATCH 1/1] " Dao Zhong Ma
2026-05-01 23:12 ` Jakub Kicinski
2026-05-03 21:14 ` Antonio Quartulli [this message]
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=b359d13d-8414-4aeb-958c-496b4b898b93@openvpn.net \
--to=antonio@openvpn.net \
--cc=andrew+netdev@lunn.ch \
--cc=cz1346219@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ralf@mandelbit.com \
--cc=sd@queasysnail.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox