summaryrefslogtreecommitdiff
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-11 20:05:30 +0300
committerPaolo Abeni <pabeni@redhat.com>2023-09-12 20:10:01 +0300
commit4505dc2a522826975167823f64f0896bac1323fb (patch)
treeca24379daf4c8c19ce173fdfd3bc510366cb9ad5 /net/core/sock.c
parent11445469dec803730ac7f78a5ad2a5ed131fa941 (diff)
downloadlinux-4505dc2a522826975167823f64f0896bac1323fb.tar.xz
net: call prot->release_cb() when processing backlog
__sk_flush_backlog() / sk_flush_backlog() are used when TCP recvmsg()/sendmsg() process large chunks, to not let packets in the backlog too long. It makes sense to call tcp_release_cb() to also process actions held in sk->sk_tsq_flags for smoother scheduling. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 21610e3845a5..bb89b88bc1e8 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3001,6 +3001,9 @@ void __sk_flush_backlog(struct sock *sk)
{
spin_lock_bh(&sk->sk_lock.slock);
__release_sock(sk);
+
+ if (sk->sk_prot->release_cb)
+ sk->sk_prot->release_cb(sk);
spin_unlock_bh(&sk->sk_lock.slock);
}
EXPORT_SYMBOL_GPL(__sk_flush_backlog);