From: David Howells <dhowells@redhat.com>
To: netdev@vger.kernel.org
Cc: linux-afs@lists.infradead.org,
Marc Dionne <marc.dionne@auristor.com>,
Jakub Kicinski <kuba@kernel.org>,
dhowells@redhat.com, linux-afs@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next 00/36] rxrpc: Increasing SACK size and moving away from softirq, parts 2 & 3
Date: Fri, 02 Dec 2022 00:15:03 +0000 [thread overview]
Message-ID: <166994010342.1732290.13771061038178613124.stgit@warthog.procyon.org.uk> (raw)
Here are the second and third parts of patches in the process of moving
rxrpc from doing a lot of its stuff in softirq context to doing it in an
I/O thread in process context and thereby making it easier to support a
larger SACK table.
The full description is in the description for the first part[1] which is
already in net-next.
The second part includes some cleanups, adds some testing and overhauls
some tracing:
(1) Remove declaration of rxrpc_kernel_call_is_complete() as the
definition is no longer present.
(2) Remove the knet() and kproto() macros in favour of using tracepoints.
(3) Remove handling of duplicate packets from recvmsg. The input side
isn't now going to insert overlapping/duplicate packets into the
recvmsg queue.
(4) Don't use the rxrpc_conn_parameters struct in the rxrpc_connection or
rxrpc_bundle structs - rather put the members in directly.
(5) Extract the abort code from a received abort packet right up front
rather than doing it in multiple places later.
(6) Use enums and symbol lists rather than __builtin_return_address() to
indicate where a tracepoint was triggered for local, peer, conn, call
and skbuff tracing.
(7) Add a refcount tracepoint for the rxrpc_bundle struct.
(8) Implement an in-kernel server for the AFS rxperf testing program to
talk to (enabled by a Kconfig option).
This is tagged as rxrpc-next-20221201-a.
The third part introduces the I/O thread and switches various bits over to
running there:
(1) Fix call timers and call and connection workqueues to not hold refs on
the rxrpc_call and rxrpc_connection structs to thereby avoid messy
cleanup when the last ref is put in softirq mode.
(2) Split input.c so that the call packet processing bits are separate
from the received packet distribution bits. Call packet processing
gets bumped over to the call event handler.
(3) Create a per-local endpoint I/O thread. Barring some tiny bits that
still get done in softirq context, all packet reception, processing
and transmission is done in this thread. That will allow a load of
locking to be removed.
(4) Perform packet processing and error processing from the I/O thread.
(5) Provide a mechanism to process call event notifications in the I/O
thread rather than queuing a work item for that call.
(6) Move data and ACK transmission into the I/O thread. ACKs can then be
transmitted at the point they're generated rather than getting
delegated from softirq context to some process context somewhere.
(7) Move call and local processor event handling into the I/O thread.
(8) Move cwnd degradation to after packets have been transmitted so that
they don't shorten the window too quickly.
A bunch of simplifications can then be done:
(1) The input_lock is no longer necessary as exclusion is achieved by
running the code in the I/O thread only.
(2) Don't need to use sk->sk_receive_queue.lock to guard socket state
changes as the socket mutex should suffice.
(3) Don't take spinlocks in RCU callback functions as they get run in
softirq context and thus need _bh annotations.
(4) RCU is then no longer needed for the peer's error_targets list.
(5) Simplify the skbuff handling in the receive path by dropping the ref
in the basic I/O thread loop and getting an extra ref as and when we
need to queue the packet for recvmsg or another context.
(6) Get the peer address earlier in the input process and pass it to the
users so that we only do it once.
This is tagged as rxrpc-next-20221201-b.
Changes:
========
ver #2)
- Added a patch to change four assertions into warnings in rxrpc_read()
and fixed a checker warning from a __user annotation that should have
been removed..
- Change a min() to min_t() in rxperf as PAGE_SIZE doesn't seem to match
type size_t on i386.
- Three error handling issues in rxrpc_new_incoming_call():
- If not DATA or not seq #1, should drop the packet, not abort.
- Fix a goto that went to the wrong place, dropping a non-held lock.
- Fix an rcu_read_lock that should've been an unlock.
Tested-by: Marc Dionne <marc.dionne@auristor.com>
Tested-by: kafs-testing+fedora36_64checkkafs-build-144@auristor.com
Link: https://lore.kernel.org/r/166794587113.2389296.16484814996876530222.stgit@warthog.procyon.org.uk/ [1]
Link: https://lore.kernel.org/r/166982725699.621383.2358362793992993374.stgit@warthog.procyon.org.uk/ # v1
---
The patches are tagged here:
git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git tags/rxrpc-next-20221201-b
And can be found on this branch:
http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-next
David
---
David Howells (36):
rxrpc: Fix checker warning
rxrpc: Implement an in-kernel rxperf server for testing purposes
rxrpc: Fix call leak
rxrpc: Remove decl for rxrpc_kernel_call_is_complete()
rxrpc: Remove handling of duplicate packets in recvmsg_queue
rxrpc: Remove the [k_]proto() debugging macros
rxrpc: Remove the [_k]net() debugging macros
rxrpc: Drop rxrpc_conn_parameters from rxrpc_connection and rxrpc_bundle
rxrpc: Extract the code from a received ABORT packet much earlier
rxrpc: trace: Don't use __builtin_return_address for rxrpc_local tracing
rxrpc: trace: Don't use __builtin_return_address for rxrpc_peer tracing
rxrpc: trace: Don't use __builtin_return_address for rxrpc_conn tracing
rxrpc: trace: Don't use __builtin_return_address for rxrpc_call tracing
rxrpc: Trace rxrpc_bundle refcount
rxrpc: trace: Don't use __builtin_return_address for sk_buff tracing
rxrpc: Don't hold a ref for call timer or workqueue
rxrpc: Don't hold a ref for connection workqueue
rxrpc: Split the receive code
rxrpc: Create a per-local endpoint receive queue and I/O thread
rxrpc: Move packet reception processing into I/O thread
rxrpc: Move error processing into the local endpoint I/O thread
rxrpc: Remove call->input_lock
rxrpc: Don't use sk->sk_receive_queue.lock to guard socket state changes
rxrpc: Implement a mechanism to send an event notification to a call
rxrpc: Copy client call parameters into rxrpc_call earlier
rxrpc: Move DATA transmission into call processor work item
rxrpc: Remove RCU from peer->error_targets list
rxrpc: Simplify skbuff accounting in receive path
rxrpc: Reduce the use of RCU in packet input
rxrpc: Extract the peer address from an incoming packet earlier
rxrpc: Make the I/O thread take over the call and local processor work
rxrpc: Remove the _bh annotation from all the spinlocks
rxrpc: Trace/count transmission underflows and cwnd resets
rxrpc: Move the cwnd degradation after transmitting packets
rxrpc: Fold __rxrpc_unuse_local() into rxrpc_unuse_local()
rxrpc: Transmit ACKs at the point of generation
include/net/af_rxrpc.h | 2 +-
include/trace/events/rxrpc.h | 486 +++++++++++++++++++-------
net/rxrpc/Kconfig | 7 +
net/rxrpc/Makefile | 4 +
net/rxrpc/af_rxrpc.c | 18 +-
net/rxrpc/ar-internal.h | 211 +++++------
net/rxrpc/call_accept.c | 191 +++++-----
net/rxrpc/call_event.c | 260 ++++++++------
net/rxrpc/call_object.c | 318 ++++++++---------
net/rxrpc/conn_client.c | 143 ++++----
net/rxrpc/conn_event.c | 128 ++++---
net/rxrpc/conn_object.c | 309 ++++++++---------
net/rxrpc/conn_service.c | 29 +-
net/rxrpc/input.c | 653 +++++------------------------------
net/rxrpc/io_thread.c | 496 ++++++++++++++++++++++++++
net/rxrpc/key.c | 16 +-
net/rxrpc/local_event.c | 46 +--
net/rxrpc/local_object.c | 167 +++------
net/rxrpc/net_ns.c | 2 +-
net/rxrpc/output.c | 227 ++++++------
net/rxrpc/peer_event.c | 167 +++------
net/rxrpc/peer_object.c | 52 ++-
net/rxrpc/proc.c | 67 ++--
net/rxrpc/recvmsg.c | 88 ++---
net/rxrpc/rxkad.c | 63 ++--
net/rxrpc/rxperf.c | 619 +++++++++++++++++++++++++++++++++
net/rxrpc/security.c | 34 +-
net/rxrpc/sendmsg.c | 105 ++----
net/rxrpc/server_key.c | 25 ++
net/rxrpc/skbuff.c | 36 +-
net/rxrpc/txbuf.c | 15 +-
31 files changed, 2882 insertions(+), 2102 deletions(-)
create mode 100644 net/rxrpc/io_thread.c
create mode 100644 net/rxrpc/rxperf.c
next reply other threads:[~2022-12-02 0:16 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-02 0:15 David Howells [this message]
2022-12-02 0:15 ` [PATCH net-next 01/36] rxrpc: Fix checker warning David Howells
2022-12-02 0:15 ` [PATCH net-next 02/36] rxrpc: Implement an in-kernel rxperf server for testing purposes David Howells
2022-12-02 0:15 ` [PATCH net-next 03/36] rxrpc: Fix call leak David Howells
2022-12-02 0:15 ` [PATCH net-next 04/36] rxrpc: Remove decl for rxrpc_kernel_call_is_complete() David Howells
2022-12-02 0:15 ` [PATCH net-next 05/36] rxrpc: Remove handling of duplicate packets in recvmsg_queue David Howells
2022-12-02 0:15 ` [PATCH net-next 06/36] rxrpc: Remove the [k_]proto() debugging macros David Howells
2022-12-02 0:16 ` [PATCH net-next 07/36] rxrpc: Remove the [_k]net() " David Howells
2022-12-02 0:16 ` [PATCH net-next 08/36] rxrpc: Drop rxrpc_conn_parameters from rxrpc_connection and rxrpc_bundle David Howells
2022-12-02 0:16 ` [PATCH net-next 09/36] rxrpc: Extract the code from a received ABORT packet much earlier David Howells
2022-12-02 0:16 ` [PATCH net-next 10/36] rxrpc: trace: Don't use __builtin_return_address for rxrpc_local tracing David Howells
2022-12-02 0:16 ` [PATCH net-next 11/36] rxrpc: trace: Don't use __builtin_return_address for rxrpc_peer tracing David Howells
2022-12-02 0:16 ` [PATCH net-next 12/36] rxrpc: trace: Don't use __builtin_return_address for rxrpc_conn tracing David Howells
2022-12-02 0:16 ` [PATCH net-next 13/36] rxrpc: trace: Don't use __builtin_return_address for rxrpc_call tracing David Howells
2022-12-02 0:17 ` [PATCH net-next 14/36] rxrpc: Trace rxrpc_bundle refcount David Howells
2022-12-02 0:17 ` [PATCH net-next 15/36] rxrpc: trace: Don't use __builtin_return_address for sk_buff tracing David Howells
2022-12-02 0:17 ` [PATCH net-next 16/36] rxrpc: Don't hold a ref for call timer or workqueue David Howells
2022-12-02 0:17 ` [PATCH net-next 17/36] rxrpc: Don't hold a ref for connection workqueue David Howells
2022-12-02 0:17 ` [PATCH net-next 18/36] rxrpc: Split the receive code David Howells
2022-12-02 0:17 ` [PATCH net-next 19/36] rxrpc: Create a per-local endpoint receive queue and I/O thread David Howells
2022-12-02 0:17 ` [PATCH net-next 20/36] rxrpc: Move packet reception processing into " David Howells
2022-12-02 0:18 ` [PATCH net-next 21/36] rxrpc: Move error processing into the local endpoint " David Howells
2022-12-02 0:18 ` [PATCH net-next 22/36] rxrpc: Remove call->input_lock David Howells
2022-12-02 0:18 ` [PATCH net-next 23/36] rxrpc: Don't use sk->sk_receive_queue.lock to guard socket state changes David Howells
2022-12-02 0:18 ` [PATCH net-next 24/36] rxrpc: Implement a mechanism to send an event notification to a call David Howells
2022-12-02 0:18 ` [PATCH net-next 25/36] rxrpc: Copy client call parameters into rxrpc_call earlier David Howells
2022-12-02 0:18 ` [PATCH net-next 26/36] rxrpc: Move DATA transmission into call processor work item David Howells
2022-12-02 0:18 ` [PATCH net-next 27/36] rxrpc: Remove RCU from peer->error_targets list David Howells
2022-12-02 0:19 ` [PATCH net-next 28/36] rxrpc: Simplify skbuff accounting in receive path David Howells
2022-12-02 0:19 ` [PATCH net-next 29/36] rxrpc: Reduce the use of RCU in packet input David Howells
2022-12-02 0:19 ` [PATCH net-next 30/36] rxrpc: Extract the peer address from an incoming packet earlier David Howells
2022-12-02 0:19 ` [PATCH net-next 31/36] rxrpc: Make the I/O thread take over the call and local processor work David Howells
2022-12-02 0:19 ` [PATCH net-next 32/36] rxrpc: Remove the _bh annotation from all the spinlocks David Howells
2022-12-02 0:19 ` [PATCH net-next 33/36] rxrpc: Trace/count transmission underflows and cwnd resets David Howells
2022-12-02 0:19 ` [PATCH net-next 34/36] rxrpc: Move the cwnd degradation after transmitting packets David Howells
2022-12-02 0:20 ` [PATCH net-next 35/36] rxrpc: Fold __rxrpc_unuse_local() into rxrpc_unuse_local() David Howells
2022-12-02 0:20 ` [PATCH net-next 36/36] rxrpc: Transmit ACKs at the point of generation David Howells
2022-12-05 11:10 ` [PATCH net-next 00/36] rxrpc: Increasing SACK size and moving away from softirq, parts 2 & 3 patchwork-bot+netdevbpf
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=166994010342.1732290.13771061038178613124.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=kuba@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.