提交 69ffaebb 编写于 作者: D David Howells 提交者: David S. Miller

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: 45025bce ("rxrpc: Improve management and caching of client connection objects")
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Reviewed-by: NMarc Dionne <marc.dionne@auristor.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c3ad3eca
...@@ -353,7 +353,7 @@ static int rxrpc_get_client_conn(struct rxrpc_sock *rx, ...@@ -353,7 +353,7 @@ static int rxrpc_get_client_conn(struct rxrpc_sock *rx,
* normally have to take channel_lock but we do this before anyone else * normally have to take channel_lock but we do this before anyone else
* can see the connection. * can see the connection.
*/ */
list_add_tail(&call->chan_wait_link, &candidate->waiting_calls); list_add(&call->chan_wait_link, &candidate->waiting_calls);
if (cp->exclusive) { if (cp->exclusive) {
call->conn = candidate; call->conn = candidate;
...@@ -432,7 +432,7 @@ static int rxrpc_get_client_conn(struct rxrpc_sock *rx, ...@@ -432,7 +432,7 @@ static int rxrpc_get_client_conn(struct rxrpc_sock *rx,
call->conn = conn; call->conn = conn;
call->security_ix = conn->security_ix; call->security_ix = conn->security_ix;
call->service_id = conn->service_id; call->service_id = conn->service_id;
list_add(&call->chan_wait_link, &conn->waiting_calls); list_add_tail(&call->chan_wait_link, &conn->waiting_calls);
spin_unlock(&conn->channel_lock); spin_unlock(&conn->channel_lock);
_leave(" = 0 [extant %d]", conn->debug_id); _leave(" = 0 [extant %d]", conn->debug_id);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册