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 1/4] tcp: no longer release socket ownership in tcp_release_cb()
Date: Wed,  6 Sep 2023 20:10:43 +0000	[thread overview]
Message-ID: <20230906201046.463236-2-edumazet@google.com> (raw)
In-Reply-To: <20230906201046.463236-1-edumazet@google.com>

This partially reverts c3f9b01849ef ("tcp: tcp_release_cb()
should release socket ownership").

prequeue has been removed by Florian in commit e7942d0633c4
("tcp: remove prequeue support")

__tcp_checksum_complete_user() being gone, we no longer
have to release socket ownership in tcp_release_cb().

This is a prereq for third patch in the series
("net: call prot->release_cb() when processing backlog").

Signed-off-by: Eric Dumazet <edumazet@google•com>
---
 net/core/sock.c       |  3 ---
 net/ipv4/tcp_output.c | 10 ----------
 2 files changed, 13 deletions(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index 16584e2dd6481a3fc28d796db785439f0446703b..21610e3845a5042f7c648ccb3e0d90126df20a0b 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3519,9 +3519,6 @@ void release_sock(struct sock *sk)
 	if (sk->sk_backlog.tail)
 		__release_sock(sk);
 
-	/* Warning : release_cb() might need to release sk ownership,
-	 * ie call sock_release_ownership(sk) before us.
-	 */
 	if (sk->sk_prot->release_cb)
 		sk->sk_prot->release_cb(sk);
 
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index ccfc8bbf745586cd23dcf02d755d6981dc92742e..b4cac12d0e6348aaa3a3957b0091ea7fe6553731 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1101,16 +1101,6 @@ void tcp_release_cb(struct sock *sk)
 		tcp_tsq_write(sk);
 		__sock_put(sk);
 	}
-	/* Here begins the tricky part :
-	 * We are called from release_sock() with :
-	 * 1) BH disabled
-	 * 2) sk_lock.slock spinlock held
-	 * 3) socket owned by us (sk->sk_lock.owned == 1)
-	 *
-	 * But following code is meant to be called from BH handlers,
-	 * so we should keep BH disabled, but early release socket ownership
-	 */
-	sock_release_ownership(sk);
 
 	if (flags & TCPF_WRITE_TIMER_DEFERRED) {
 		tcp_write_timer_handler(sk);
-- 
2.42.0.283.g2d96d420d3-goog


  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 ` Eric Dumazet [this message]
2023-09-06 20:10 ` [RFC net-next 2/4] net: sock_release_ownership() cleanup Eric Dumazet
2023-09-06 20:10 ` [RFC net-next 3/4] net: call prot->release_cb() when processing backlog Eric Dumazet
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-2-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