Commit fefe89f4 authored by Trond Myklebust's avatar Trond Myklebust

[PATCH] RPC over UDP congestion control updates [8/8]

When determining who gets access to the socket, give priority to
requests that are being resent. Despite the fact that congestion
control now applies to resends, we still want to ensure that resends
get ACKed as soon as possible (and before we start sending off new
requests).
parent 0b51abc8
...@@ -123,6 +123,7 @@ struct rpc_xprt { ...@@ -123,6 +123,7 @@ struct rpc_xprt {
unsigned long cwnd; /* congestion window */ unsigned long cwnd; /* congestion window */
struct rpc_wait_queue sending; /* requests waiting to send */ struct rpc_wait_queue sending; /* requests waiting to send */
struct rpc_wait_queue resend; /* requests waiting to resend */
struct rpc_wait_queue pending; /* requests in flight */ struct rpc_wait_queue pending; /* requests in flight */
struct rpc_wait_queue backlog; /* waiting for slot */ struct rpc_wait_queue backlog; /* waiting for slot */
struct rpc_rqst * free; /* free slots */ struct rpc_rqst * free; /* free slots */
......
...@@ -150,7 +150,10 @@ xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task) ...@@ -150,7 +150,10 @@ xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
task->tk_pid, xprt->snd_task->tk_pid); task->tk_pid, xprt->snd_task->tk_pid);
task->tk_timeout = 0; task->tk_timeout = 0;
task->tk_status = -EAGAIN; task->tk_status = -EAGAIN;
rpc_sleep_on(&xprt->sending, task, NULL, NULL); if (task->tk_rqstp->rq_nresend)
rpc_sleep_on(&xprt->resend, task, NULL, NULL);
else
rpc_sleep_on(&xprt->sending, task, NULL, NULL);
} }
retval = xprt->snd_task == task; retval = xprt->snd_task == task;
spin_unlock_bh(&xprt->sock_lock); spin_unlock_bh(&xprt->sock_lock);
...@@ -166,9 +169,12 @@ __xprt_lock_write_next(struct rpc_xprt *xprt) ...@@ -166,9 +169,12 @@ __xprt_lock_write_next(struct rpc_xprt *xprt)
return; return;
if (!xprt->nocong && RPCXPRT_CONGESTED(xprt)) if (!xprt->nocong && RPCXPRT_CONGESTED(xprt))
return; return;
task = rpc_wake_up_next(&xprt->sending); task = rpc_wake_up_next(&xprt->resend);
if (!task) if (!task) {
return; task = rpc_wake_up_next(&xprt->sending);
if (!task)
return;
}
if (xprt->nocong || __xprt_get_cong(xprt, task)) if (xprt->nocong || __xprt_get_cong(xprt, task))
xprt->snd_task = task; xprt->snd_task = task;
} }
...@@ -1346,6 +1352,7 @@ xprt_setup(struct socket *sock, int proto, ...@@ -1346,6 +1352,7 @@ xprt_setup(struct socket *sock, int proto,
INIT_RPC_WAITQ(&xprt->pending, "xprt_pending"); INIT_RPC_WAITQ(&xprt->pending, "xprt_pending");
INIT_RPC_WAITQ(&xprt->sending, "xprt_sending"); INIT_RPC_WAITQ(&xprt->sending, "xprt_sending");
INIT_RPC_WAITQ(&xprt->resend, "xprt_resend");
INIT_RPC_WAITQ(&xprt->backlog, "xprt_backlog"); INIT_RPC_WAITQ(&xprt->backlog, "xprt_backlog");
/* initialize free list */ /* initialize free list */
...@@ -1477,6 +1484,7 @@ xprt_shutdown(struct rpc_xprt *xprt) ...@@ -1477,6 +1484,7 @@ xprt_shutdown(struct rpc_xprt *xprt)
{ {
xprt->shutdown = 1; xprt->shutdown = 1;
rpc_wake_up(&xprt->sending); rpc_wake_up(&xprt->sending);
rpc_wake_up(&xprt->resend);
rpc_wake_up(&xprt->pending); rpc_wake_up(&xprt->pending);
rpc_wake_up(&xprt->backlog); rpc_wake_up(&xprt->backlog);
if (waitqueue_active(&xprt->cong_wait)) if (waitqueue_active(&xprt->cong_wait))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment