Re: [PATCH] net: remove release/lock_sock in tcp_splice_read

From: Paolo Abeni
Date: Thu Aug 15 2024 - 07:25:07 EST




On 8/15/24 12:55, Jason Xing wrote:
On Thu, Aug 15, 2024 at 6:40 PM Paolo Abeni <pabeni@xxxxxxxxxx> wrote:
[...]
- release_sock(sk);
- lock_sock(sk);

This is needed to flush the sk backlog.

Somewhat related, I think we could replace the pair with sk_flush_backlog().


Do you think we could do this like the following commit:

commit d41a69f1d390fa3f2546498103cdcd78b30676ff
Author: Eric Dumazet <edumazet@xxxxxxxxxx>
Date: Fri Apr 29 14:16:53 2016 -0700

tcp: make tcp_sendmsg() aware of socket backlog

Large sendmsg()/write() hold socket lock for the duration of the call,
unless sk->sk_sndbuf limit is hit. This is bad because incoming packets
are parked into socket backlog for a long time. >
?

Yep. To be more accurate I was looking at commit 93afcfd1db35882921b2521a637c78755c27b02c

In any case this should be unrelated from the supposed issue.

Cheers,

Paolo