diff options
author | David Howells <dhowells@redhat.com> | 2023-02-15 21:48:05 +0000 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-02-20 08:33:25 +0100 |
commit | c078381856230f1e8e13738661d83c2b4b433819 (patch) | |
tree | a4c3287e98c4aca17b78ea5b0c47656511b57883 /include/trace | |
parent | d269ac136ede573c90c18a66961143294ef564e5 (diff) | |
download | linux-stable-c078381856230f1e8e13738661d83c2b4b433819.tar.gz linux-stable-c078381856230f1e8e13738661d83c2b4b433819.tar.bz2 linux-stable-c078381856230f1e8e13738661d83c2b4b433819.zip |
rxrpc: Fix overproduction of wakeups to recvmsg()
Fix three cases of overproduction of wakeups:
(1) rxrpc_input_split_jumbo() conditionally notifies the app that there's
data for recvmsg() to collect if it queues some data - and then its
only caller, rxrpc_input_data(), goes and wakes up recvmsg() anyway.
Fix the rxrpc_input_data() to only do the wakeup in failure cases.
(2) If a DATA packet is received for a call by the I/O thread whilst
recvmsg() is busy draining the call's rx queue in the app thread, the
call will left on the recvmsg() queue for recvmsg() to pick up, even
though there isn't any data on it.
This can cause an unexpected recvmsg() with a 0 return and no MSG_EOR
set after the reply has been posted to a service call.
Fix this by discarding pending calls from the recvmsg() queue that
don't need servicing yet.
(3) Not-yet-completed calls get requeued after having data read from them,
even if they have no data to read.
Fix this by only requeuing them if they have data waiting on them; if
they don't, the I/O thread will requeue them when data arrives or they
fail.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/3386149.1676497685@warthog.procyon.org.uk
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/rxrpc.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h index c3c0b0aa8381..4c53a5ef6257 100644 --- a/include/trace/events/rxrpc.h +++ b/include/trace/events/rxrpc.h @@ -318,6 +318,7 @@ EM(rxrpc_recvmsg_return, "RETN") \ EM(rxrpc_recvmsg_terminal, "TERM") \ EM(rxrpc_recvmsg_to_be_accepted, "TBAC") \ + EM(rxrpc_recvmsg_unqueue, "UNQU") \ E_(rxrpc_recvmsg_wait, "WAIT") #define rxrpc_rtt_tx_traces \ |