Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1478420 > unrolled thread
| Started by | David Howells <dhowells@redhat.com> |
|---|---|
| First post | 2016-09-07 17:30 +0200 |
| Last post | 2016-09-08 02:30 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH net-next 0/8] rxrpc: Overhaul call refcounting David Howells <dhowells@redhat.com> - 2016-09-07 17:30 +0200
[PATCH net-next 6/8] rxrpc: Pass the connection pointer to rxrpc_post_packet_to_call() David Howells <dhowells@redhat.com> - 2016-09-07 17:30 +0200
[PATCH net-next 1/8] rxrpc: Whitespace cleanup David Howells <dhowells@redhat.com> - 2016-09-07 17:30 +0200
[PATCH net-next 4/8] rxrpc: Use call->peer rather than call->conn->params.peer David Howells <dhowells@redhat.com> - 2016-09-07 17:30 +0200
Re: [PATCH net-next 0/8] rxrpc: Overhaul call refcounting David Miller <davem@davemloft.net> - 2016-09-08 02:30 +0200
| From | David Howells <dhowells@redhat.com> |
|---|---|
| Date | 2016-09-07 17:30 +0200 |
| Subject | [PATCH net-next 0/8] rxrpc: Overhaul call refcounting |
| Message-ID | <seMXv-1t1-3@gated-at.bofh.it> |
Here's a set of mostly small patches leading up to one big one.
The big patch at the end of the series overhauls how rxrpc_call refcounting
is handled, making it more sane so that calls bound to user IDs are _only_
released from socket operations or kernel API functions. Further, the
patch stops calls from holding refs on their parent socket - which can
prevent the socket from being cleaned up.
The second largest patch improves the call tracking tracepoint by providing
extra information about the situation in which gets and puts occur. This
allows distinctions to be drawn between refs held by the socket user ID
tree, refs held by the work queue (to be implemented by a future patch) and
other refs.
The other patches include a couple of cleanups and some simple alterations
to avoid NULL pointer dereferences in the big patch.
The patches can be found here also (non-terminally on the branch):
http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-rewrite
Tagged thusly:
git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
rxrpc-rewrite-20160907-1
David
---
David Howells (8):
rxrpc: Whitespace cleanup
rxrpc: Delete unused rxrpc_kernel_free_skb()
rxrpc: Improve the call tracking tracepoint
rxrpc: Use call->peer rather than call->conn->params.peer
rxrpc: Cache the security index in the rxrpc_call struct
rxrpc: Pass the connection pointer to rxrpc_post_packet_to_call()
rxrpc: Use rxrpc_is_service_call() rather than rxrpc_conn_is_service()
rxrpc: Calls shouldn't hold socket refs
include/trace/events/rxrpc.h | 11 --
net/rxrpc/af_rxrpc.c | 6 -
net/rxrpc/ar-internal.h | 41 ++++--
net/rxrpc/call_accept.c | 63 +++-------
net/rxrpc/call_event.c | 74 +++++------
net/rxrpc/call_object.c | 277 +++++++++++++++++++-----------------------
net/rxrpc/conn_client.c | 3
net/rxrpc/input.c | 39 +++---
net/rxrpc/output.c | 145 ++++++++++++++++++++++
net/rxrpc/proc.c | 4 -
net/rxrpc/recvmsg.c | 47 ++-----
net/rxrpc/sendmsg.c | 6 -
net/rxrpc/skbuff.c | 16 --
net/rxrpc/sysctl.c | 8 -
14 files changed, 393 insertions(+), 347 deletions(-)
[toc] | [next] | [standalone]
| From | David Howells <dhowells@redhat.com> |
|---|---|
| Date | 2016-09-07 17:30 +0200 |
| Subject | [PATCH net-next 6/8] rxrpc: Pass the connection pointer to rxrpc_post_packet_to_call() |
| Message-ID | <seMXw-1t1-61@gated-at.bofh.it> |
| In reply to | #1478420 |
Pass the connection pointer to rxrpc_post_packet_to_call() as the call
might get disconnected whilst we're looking at it, but the connection
pointer determined by rxrpc_data_read() is guaranteed by RCU for the
duration of the call.
Signed-off-by: David Howells <dhowells@redhat.com>
---
net/rxrpc/input.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index 9242fefd7f40..52da4373131f 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -497,7 +497,8 @@ protocol_error:
* post an incoming packet to the appropriate call/socket to deal with
* - must get rid of the sk_buff, either by freeing it or by queuing it
*/
-static void rxrpc_post_packet_to_call(struct rxrpc_call *call,
+static void rxrpc_post_packet_to_call(struct rxrpc_connection *conn,
+ struct rxrpc_call *call,
struct sk_buff *skb)
{
struct rxrpc_skb_priv *sp;
@@ -558,7 +559,7 @@ resend_final_ack:
dead_call:
if (sp->hdr.type != RXRPC_PACKET_TYPE_ABORT) {
skb->priority = RX_CALL_DEAD;
- rxrpc_reject_packet(call->conn->params.local, skb);
+ rxrpc_reject_packet(conn->params.local, skb);
goto unlock;
}
free_unlock:
@@ -754,7 +755,7 @@ void rxrpc_data_ready(struct sock *sk)
goto cant_route_call;
rxrpc_see_call(call);
- rxrpc_post_packet_to_call(call, skb);
+ rxrpc_post_packet_to_call(conn, call, skb);
goto out_unlock;
}
[toc] | [prev] | [next] | [standalone]
| From | David Howells <dhowells@redhat.com> |
|---|---|
| Date | 2016-09-07 17:30 +0200 |
| Subject | [PATCH net-next 1/8] rxrpc: Whitespace cleanup |
| Message-ID | <seMXw-1t1-63@gated-at.bofh.it> |
| In reply to | #1478420 |
Remove some whitespace.
Signed-off-by: David Howells <dhowells@redhat.com>
---
net/rxrpc/ar-internal.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index bb342f5fe7e4..ad702f9f8d1f 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -720,7 +720,6 @@ static inline void rxrpc_put_connection(struct rxrpc_connection *conn)
}
}
-
static inline bool rxrpc_queue_conn(struct rxrpc_connection *conn)
{
if (!rxrpc_get_connection_maybe(conn))
@@ -879,7 +878,7 @@ int __init rxrpc_init_security(void);
void rxrpc_exit_security(void);
int rxrpc_init_client_conn_security(struct rxrpc_connection *);
int rxrpc_init_server_conn_security(struct rxrpc_connection *);
-
+
/*
* sendmsg.c
*/
[toc] | [prev] | [next] | [standalone]
| From | David Howells <dhowells@redhat.com> |
|---|---|
| Date | 2016-09-07 17:30 +0200 |
| Subject | [PATCH net-next 4/8] rxrpc: Use call->peer rather than call->conn->params.peer |
| Message-ID | <seMXw-1t1-67@gated-at.bofh.it> |
| In reply to | #1478420 |
Use call->peer rather than call->conn->params.peer to avoid the possibility
of call->conn being NULL and, whilst we're at it, check it for NULL before we
access it.
Signed-off-by: David Howells <dhowells@redhat.com>
---
net/rxrpc/call_object.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c
index 3166b5222435..060ddc32a85e 100644
--- a/net/rxrpc/call_object.c
+++ b/net/rxrpc/call_object.c
@@ -514,9 +514,11 @@ void rxrpc_release_call(struct rxrpc_call *call)
*/
_debug("RELEASE CALL %p (%d CONN %p)", call, call->debug_id, conn);
- spin_lock(&conn->params.peer->lock);
- hlist_del_init(&call->error_link);
- spin_unlock(&conn->params.peer->lock);
+ if (call->peer) {
+ spin_lock(&call->peer->lock);
+ hlist_del_init(&call->error_link);
+ spin_unlock(&call->peer->lock);
+ }
write_lock_bh(&rx->call_lock);
if (!list_empty(&call->accept_link)) {
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2016-09-08 02:30 +0200 |
| Message-ID | <seVo6-754-11@gated-at.bofh.it> |
| In reply to | #1478420 |
From: David Howells <dhowells@redhat.com> Date: Wed, 07 Sep 2016 16:22:26 +0100 > > Here's a set of mostly small patches leading up to one big one. > > The big patch at the end of the series overhauls how rxrpc_call refcounting > is handled, making it more sane so that calls bound to user IDs are _only_ > released from socket operations or kernel API functions. Further, the > patch stops calls from holding refs on their parent socket - which can > prevent the socket from being cleaned up. > > The second largest patch improves the call tracking tracepoint by providing > extra information about the situation in which gets and puts occur. This > allows distinctions to be drawn between refs held by the socket user ID > tree, refs held by the work queue (to be implemented by a future patch) and > other refs. > > The other patches include a couple of cleanups and some simple alterations > to avoid NULL pointer dereferences in the big patch. > > The patches can be found here also (non-terminally on the branch): > > http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-rewrite > > Tagged thusly: > > git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git > rxrpc-rewrite-20160907-1 Pulled.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web