Commit 5579cbd6 authored by Trond Myklebust's avatar Trond Myklebust

A request cannot be used as part of the RTO estimation if it gets

resent since you don't know whether the server is replying to the
first or the second transmission. However we're currently setting
the cutoff point to be the timeout of the first transmission.

This patch moves the cutoff point to the actual start of the
retransmission.
parent 4bdeac8f
...@@ -115,7 +115,7 @@ struct rpc_rqst { ...@@ -115,7 +115,7 @@ struct rpc_rqst {
unsigned long rq_xtime; /* when transmitted */ unsigned long rq_xtime; /* when transmitted */
int rq_ntimeo; int rq_ntimeo;
int rq_nresend; int rq_ntrans;
}; };
#define rq_svec rq_snd_buf.head #define rq_svec rq_snd_buf.head
#define rq_slen rq_snd_buf.len #define rq_slen rq_snd_buf.len
......
...@@ -143,15 +143,17 @@ __xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task) ...@@ -143,15 +143,17 @@ __xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
if (!xprt->snd_task) { if (!xprt->snd_task) {
if (xprt->nocong || __xprt_get_cong(xprt, task)) { if (xprt->nocong || __xprt_get_cong(xprt, task)) {
xprt->snd_task = task; xprt->snd_task = task;
if (req) if (req) {
req->rq_bytes_sent = 0; req->rq_bytes_sent = 0;
req->rq_ntrans++;
}
} }
} }
if (xprt->snd_task != task) { if (xprt->snd_task != task) {
dprintk("RPC: %4d TCP write queue full\n", task->tk_pid); dprintk("RPC: %4d TCP write queue full\n", task->tk_pid);
task->tk_timeout = 0; task->tk_timeout = 0;
task->tk_status = -EAGAIN; task->tk_status = -EAGAIN;
if (req && req->rq_nresend) if (req && req->rq_ntrans)
rpc_sleep_on(&xprt->resend, task, NULL, NULL); rpc_sleep_on(&xprt->resend, task, NULL, NULL);
else else
rpc_sleep_on(&xprt->sending, task, NULL, NULL); rpc_sleep_on(&xprt->sending, task, NULL, NULL);
...@@ -189,8 +191,10 @@ __xprt_lock_write_next(struct rpc_xprt *xprt) ...@@ -189,8 +191,10 @@ __xprt_lock_write_next(struct rpc_xprt *xprt)
if (xprt->nocong || __xprt_get_cong(xprt, task)) { if (xprt->nocong || __xprt_get_cong(xprt, task)) {
struct rpc_rqst *req = task->tk_rqstp; struct rpc_rqst *req = task->tk_rqstp;
xprt->snd_task = task; xprt->snd_task = task;
if (req) if (req) {
req->rq_bytes_sent = 0; req->rq_bytes_sent = 0;
req->rq_ntrans++;
}
} }
} }
...@@ -578,7 +582,7 @@ xprt_complete_rqst(struct rpc_xprt *xprt, struct rpc_rqst *req, int copied) ...@@ -578,7 +582,7 @@ xprt_complete_rqst(struct rpc_xprt *xprt, struct rpc_rqst *req, int copied)
if (!xprt->nocong) { if (!xprt->nocong) {
xprt_adjust_cwnd(xprt, copied); xprt_adjust_cwnd(xprt, copied);
__xprt_put_cong(xprt, req); __xprt_put_cong(xprt, req);
if (!req->rq_nresend) { if (req->rq_ntrans == 1) {
unsigned timer = unsigned timer =
task->tk_msg.rpc_proc->p_timer; task->tk_msg.rpc_proc->p_timer;
if (timer) if (timer)
...@@ -1064,7 +1068,7 @@ xprt_timer(struct rpc_task *task) ...@@ -1064,7 +1068,7 @@ xprt_timer(struct rpc_task *task)
goto out; goto out;
xprt_adjust_cwnd(req->rq_xprt, -ETIMEDOUT); xprt_adjust_cwnd(req->rq_xprt, -ETIMEDOUT);
req->rq_nresend++; __xprt_put_cong(xprt, req);
dprintk("RPC: %4d xprt_timer (%s request)\n", dprintk("RPC: %4d xprt_timer (%s request)\n",
task->tk_pid, req ? "pending" : "backlogged"); task->tk_pid, req ? "pending" : "backlogged");
......
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