linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: netdev@vger.kernel.org
Cc: Marc Dionne <marc.dionne@auristor.com>,
	linux-afs@lists.infradead.org, dhowells@redhat.com,
	linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next 21/35] rxrpc: Remove call->input_lock
Date: Wed, 30 Nov 2022 16:57:19 +0000	[thread overview]
Message-ID: <166982743990.621383.18023557629272593979.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <166982725699.621383.2358362793992993374.stgit@warthog.procyon.org.uk>

Remove call->input_lock as it was only necessary to serialise access to the
state stored in the rxrpc_call struct by simultaneous softirq handlers
presenting received packets.  They now dump the packets in a queue and a
single process-context handler now processes them.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
---

 net/rxrpc/ar-internal.h |    1 -
 net/rxrpc/call_object.c |    1 -
 net/rxrpc/input.c       |   22 +++++-----------------
 3 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index 566377c64184..654e9dab107c 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -657,7 +657,6 @@ struct rxrpc_call {
 	rxrpc_seq_t		rx_consumed;	/* Highest packet consumed */
 	rxrpc_serial_t		rx_serial;	/* Highest serial received for this call */
 	u8			rx_winsize;	/* Size of Rx window */
-	spinlock_t		input_lock;	/* Lock for packet input to this call */
 
 	/* TCP-style slow-start congestion control [RFC5681].  Since the SMSS
 	 * is fixed, we keep these numbers in terms of segments (ie. DATA
diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c
index 57c8d4cc900a..f6d1b3a6f8c6 100644
--- a/net/rxrpc/call_object.c
+++ b/net/rxrpc/call_object.c
@@ -143,7 +143,6 @@ struct rxrpc_call *rxrpc_alloc_call(struct rxrpc_sock *rx, gfp_t gfp,
 	init_waitqueue_head(&call->waitq);
 	spin_lock_init(&call->notify_lock);
 	spin_lock_init(&call->tx_lock);
-	spin_lock_init(&call->input_lock);
 	spin_lock_init(&call->acks_ack_lock);
 	rwlock_init(&call->state_lock);
 	refcount_set(&call->ref, 1);
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index f4f6f3c62d03..13c52145a926 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -588,8 +588,6 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb)
 		}
 	}
 
-	spin_lock(&call->input_lock);
-
 	/* Received data implicitly ACKs all of the request packets we sent
 	 * when we're acting as a client.
 	 */
@@ -607,8 +605,6 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb)
 out:
 	trace_rxrpc_notify_socket(call->debug_id, serial);
 	rxrpc_notify_socket(call);
-
-	spin_unlock(&call->input_lock);
 	rxrpc_free_skb(skb, rxrpc_skb_put_input);
 	_leave(" [queued]");
 }
@@ -811,7 +807,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
 	offset = sizeof(struct rxrpc_wire_header);
 	if (skb_copy_bits(skb, offset, &ack, sizeof(ack)) < 0) {
 		rxrpc_proto_abort("XAK", call, 0);
-		goto out_not_locked;
+		goto out;
 	}
 	offset += sizeof(ack);
 
@@ -863,7 +859,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
 	    rxrpc_is_client_call(call)) {
 		rxrpc_set_call_completion(call, RXRPC_CALL_REMOTELY_ABORTED,
 					  0, -ENETRESET);
-		return;
+		goto out;
 	}
 
 	/* If we get an OUT_OF_SEQUENCE ACK from the server, that can also
@@ -877,7 +873,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
 	    rxrpc_is_client_call(call)) {
 		rxrpc_set_call_completion(call, RXRPC_CALL_REMOTELY_ABORTED,
 					  0, -ENETRESET);
-		return;
+		goto out;
 	}
 
 	/* Discard any out-of-order or duplicate ACKs (outside lock). */
@@ -885,7 +881,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
 		trace_rxrpc_rx_discard_ack(call->debug_id, ack_serial,
 					   first_soft_ack, call->acks_first_seq,
 					   prev_pkt, call->acks_prev_seq);
-		goto out_not_locked;
+		goto out;
 	}
 
 	info.rxMTU = 0;
@@ -893,14 +889,12 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
 	if (skb->len >= ioffset + sizeof(info) &&
 	    skb_copy_bits(skb, ioffset, &info, sizeof(info)) < 0) {
 		rxrpc_proto_abort("XAI", call, 0);
-		goto out_not_locked;
+		goto out;
 	}
 
 	if (nr_acks > 0)
 		skb_condense(skb);
 
-	spin_lock(&call->input_lock);
-
 	/* Discard any out-of-order or duplicate ACKs (inside lock). */
 	if (!rxrpc_is_ack_valid(call, first_soft_ack, prev_pkt)) {
 		trace_rxrpc_rx_discard_ack(call->debug_id, ack_serial,
@@ -992,8 +986,6 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
 
 	rxrpc_congestion_management(call, skb, &summary, acked_serial);
 out:
-	spin_unlock(&call->input_lock);
-out_not_locked:
 	rxrpc_free_skb(skb_put, rxrpc_skb_put_input);
 	rxrpc_free_skb(skb_old, rxrpc_skb_put_ack);
 }
@@ -1005,12 +997,8 @@ static void rxrpc_input_ackall(struct rxrpc_call *call, struct sk_buff *skb)
 {
 	struct rxrpc_ack_summary summary = { 0 };
 
-	spin_lock(&call->input_lock);
-
 	if (rxrpc_rotate_tx_window(call, call->tx_top, &summary))
 		rxrpc_end_tx_phase(call, false, "ETL");
-
-	spin_unlock(&call->input_lock);
 }
 
 /*



  parent reply	other threads:[~2022-11-30 17:00 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 16:54 [PATCH net-next 00/35] rxrpc: Increasing SACK size and moving away from softirq, parts 2 & 3 David Howells
2022-11-30 16:54 ` [PATCH net-next 01/35] rxrpc: Implement an in-kernel rxperf server for testing purposes David Howells
2022-12-01  4:04   ` Jakub Kicinski
2022-11-30 16:54 ` [PATCH net-next 02/35] rxrpc: Fix call leak David Howells
2022-11-30 16:54 ` [PATCH net-next 03/35] rxrpc: Remove decl for rxrpc_kernel_call_is_complete() David Howells
2022-11-30 16:54 ` [PATCH net-next 04/35] rxrpc: Remove handling of duplicate packets in recvmsg_queue David Howells
2022-11-30 16:55 ` [PATCH net-next 05/35] rxrpc: Remove the [k_]proto() debugging macros David Howells
2022-11-30 16:55 ` [PATCH net-next 06/35] rxrpc: Remove the [_k]net() " David Howells
2022-11-30 16:55 ` [PATCH net-next 07/35] rxrpc: Drop rxrpc_conn_parameters from rxrpc_connection and rxrpc_bundle David Howells
2022-11-30 16:55 ` [PATCH net-next 08/35] rxrpc: Extract the code from a received ABORT packet much earlier David Howells
2022-11-30 16:55 ` [PATCH net-next 09/35] rxrpc: trace: Don't use __builtin_return_address for rxrpc_local tracing David Howells
2022-11-30 16:55 ` [PATCH net-next 10/35] rxrpc: trace: Don't use __builtin_return_address for rxrpc_peer tracing David Howells
2022-11-30 16:55 ` [PATCH net-next 11/35] rxrpc: trace: Don't use __builtin_return_address for rxrpc_conn tracing David Howells
2022-11-30 16:56 ` [PATCH net-next 12/35] rxrpc: trace: Don't use __builtin_return_address for rxrpc_call tracing David Howells
2022-11-30 16:56 ` [PATCH net-next 13/35] rxrpc: Trace rxrpc_bundle refcount David Howells
2022-11-30 16:56 ` [PATCH net-next 14/35] rxrpc: trace: Don't use __builtin_return_address for sk_buff tracing David Howells
2022-11-30 16:56 ` [PATCH net-next 15/35] rxrpc: Don't hold a ref for call timer or workqueue David Howells
2022-11-30 16:56 ` [PATCH net-next 16/35] rxrpc: Don't hold a ref for connection workqueue David Howells
2022-11-30 16:56 ` [PATCH net-next 17/35] rxrpc: Split the receive code David Howells
2022-11-30 16:56 ` [PATCH net-next 18/35] rxrpc: Create a per-local endpoint receive queue and I/O thread David Howells
2022-11-30 16:57 ` [PATCH net-next 19/35] rxrpc: Move packet reception processing into " David Howells
2022-11-30 16:57 ` [PATCH net-next 20/35] rxrpc: Move error processing into the local endpoint " David Howells
2022-11-30 16:57 ` David Howells [this message]
2022-11-30 16:57 ` [PATCH net-next 22/35] rxrpc: Don't use sk->sk_receive_queue.lock to guard socket state changes David Howells
2022-11-30 16:57 ` [PATCH net-next 23/35] rxrpc: Implement a mechanism to send an event notification to a call David Howells
2022-11-30 16:57 ` [PATCH net-next 24/35] rxrpc: Copy client call parameters into rxrpc_call earlier David Howells
2022-11-30 16:57 ` [PATCH net-next 25/35] rxrpc: Move DATA transmission into call processor work item David Howells
2022-11-30 16:58 ` [PATCH net-next 26/35] rxrpc: Remove RCU from peer->error_targets list David Howells
2022-11-30 16:58 ` [PATCH net-next 27/35] rxrpc: Simplify skbuff accounting in receive path David Howells
2022-11-30 16:58 ` [PATCH net-next 28/35] rxrpc: Reduce the use of RCU in packet input David Howells
2022-11-30 16:58 ` [PATCH net-next 29/35] rxrpc: Extract the peer address from an incoming packet earlier David Howells
2022-11-30 16:58 ` [PATCH net-next 30/35] rxrpc: Make the I/O thread take over the call and local processor work David Howells
2022-11-30 16:58 ` [PATCH net-next 31/35] rxrpc: Remove the _bh annotation from all the spinlocks David Howells
2022-11-30 16:58 ` [PATCH net-next 32/35] rxrpc: Trace/count transmission underflows and cwnd resets David Howells
2022-11-30 16:59 ` [PATCH net-next 33/35] rxrpc: Move the cwnd degradation after transmitting packets David Howells
2022-11-30 16:59 ` [PATCH net-next 34/35] rxrpc: Fold __rxrpc_unuse_local() into rxrpc_unuse_local() David Howells
2022-11-30 16:59 ` [PATCH net-next 35/35] rxrpc: Transmit ACKs at the point of generation David Howells

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=166982743990.621383.18023557629272593979.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).