Re: [PATCH] net: remove release/lock_sock in tcp_splice_read
From: Jason Xing
Date: Thu Aug 15 2024 - 06:57:46 EST
Hello Paolo,
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.
?
Then we can avoid taking the lock too long which results in too many
packets in the backlog.
Thanks,
Jason