public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google•com>
To: "David S . Miller" <davem@davemloft•net>,
	Jakub Kicinski <kuba@kernel•org>,
	 Paolo Abeni <pabeni@redhat•com>
Cc: netdev@vger•kernel.org, eric.dumazet@gmail•com,
	 Soheil Hassas Yeganeh <soheil@google•com>,
	Neal Cardwell <ncardwell@google•com>,
	 Yuchung Cheng <ycheng@google•com>,
	Eric Dumazet <edumazet@google•com>
Subject: [RFC net-next 3/4] net: call prot->release_cb() when processing backlog
Date: Wed,  6 Sep 2023 20:10:45 +0000	[thread overview]
Message-ID: <20230906201046.463236-4-edumazet@google.com> (raw)
In-Reply-To: <20230906201046.463236-1-edumazet@google.com>

__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>
---
 net/core/sock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/core/sock.c b/net/core/sock.c
index 21610e3845a5042f7c648ccb3e0d90126df20a0b..bb89b88bc1e8a042c4ee40b3c8345dc58cb1b369 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);
-- 
2.42.0.283.g2d96d420d3-goog


  parent reply	other threads:[~2023-09-06 20:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06 20:10 [RFC net-next 0/4] tcp: backlog processing optims Eric Dumazet
2023-09-06 20:10 ` [RFC net-next 1/4] tcp: no longer release socket ownership in tcp_release_cb() Eric Dumazet
2023-09-06 20:10 ` [RFC net-next 2/4] net: sock_release_ownership() cleanup Eric Dumazet
2023-09-06 20:10 ` Eric Dumazet [this message]
2023-09-06 20:10 ` [RFC net-next 4/4] tcp: defer regular ACK while processing socket backlog Eric Dumazet
2023-09-06 20:31   ` Yuchung Cheng
2023-09-06 23:07     ` Stephen Hemminger
2023-09-07 14:07   ` Neal Cardwell
2023-09-07 14:35     ` Soheil Hassas Yeganeh
     [not found]   ` <CAA93jw7Fuov-vmxiZdW7My-AVWCOFQo4XVm9bNwAg4Td2CUNCA@mail.gmail.com>
2023-09-07 16:54     ` Eric Dumazet
2023-09-07 17:09   ` Jakub Kicinski
2023-09-07 17:16     ` Eric Dumazet
2023-09-07 18:00       ` Jakub Kicinski
2023-09-07 18:05         ` Eric Dumazet
2023-09-07 18:10           ` Jakub Kicinski

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=20230906201046.463236-4-edumazet@google.com \
    --to=edumazet@google$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=ncardwell@google$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=soheil@google$(echo .)com \
    --cc=ycheng@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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