Re: [PATCH 1/1] ovpn: tcp - defer TX from softirq to workqueue
From: Antonio Quartulli
Date: Sun May 03 2026 - 17:15:08 EST
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@xxxxxxxxx>
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.