summaryrefslogtreecommitdiffstats
path: root/net/rxrpc
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-03-08 19:29:58 -0500
committerDavid S. Miller <davem@davemloft.net>2019-03-08 21:24:53 -0500
commit69ffaebb90369ce08657b5aea4896777b9d6e8fc (patch)
tree3c25e582f882c928651fd787ad2d13f8894d2ad5 /net/rxrpc
parentc3ad3eca2f98f6f81fa096621071e1d5baabab9b (diff)
rxrpc: Fix client call queueing, waiting for channel
rxrpc_get_client_conn() adds a new call to the front of the waiting_calls queue if the connection it's going to use already exists. This is bad as it allows calls to get starved out. Fix this by adding to the tail instead. Also change the other enqueue point in the same function to put it on the front (ie. when we have a new connection). This makes the point that in the case of a new connection the new call goes at the front (though it doesn't actually matter since the queue should be unoccupied). Fixes: 45025bceef17 ("rxrpc: Improve management and caching of client connection objects") Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Marc Dionne <marc.dionne@auristor.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rxrpc')
-rw-r--r--net/rxrpc/conn_client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c
index f307a05076e1..83797b3949e2 100644
--- a/net/rxrpc/conn_client.c
+++ b/net/rxrpc/conn_client.c
@@ -353,7 +353,7 @@ static int rxrpc_get_client_conn(struct rxrpc_sock *rx,
353 * normally have to take channel_lock but we do this before anyone else 353 * normally have to take channel_lock but we do this before anyone else
354 * can see the connection. 354 * can see the connection.
355 */ 355 */
356 list_add_tail(&call->chan_wait_link, &candidate->waiting_calls); 356 list_add(&call->chan_wait_link, &candidate->waiting_calls);
357 357
358 if (cp->exclusive) { 358 if (cp->exclusive) {
359 call->conn = candidate; 359 call->conn = candidate;
@@ -432,7 +432,7 @@ found_extant_conn:
432 call->conn = conn; 432 call->conn = conn;
433 call->security_ix = conn->security_ix; 433 call->security_ix = conn->security_ix;
434 call->service_id = conn->service_id; 434 call->service_id = conn->service_id;
435 list_add(&call->chan_wait_link, &conn->waiting_calls); 435 list_add_tail(&call->chan_wait_link, &conn->waiting_calls);
436 spin_unlock(&conn->channel_lock); 436 spin_unlock(&conn->channel_lock);
437 _leave(" = 0 [extant %d]", conn->debug_id); 437 _leave(" = 0 [extant %d]", conn->debug_id);
438 return 0; 438 return 0;