]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] RPC over UDP congestion control updates [8/8]
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Tue, 16 Jul 2002 08:55:05 +0000 (01:55 -0700)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Tue, 16 Jul 2002 08:55:05 +0000 (01:55 -0700)
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).

include/linux/sunrpc/xprt.h
net/sunrpc/xprt.c

index e123b110f719441687801c6db130edb1460e5f31..0a247f460ff775ac551c06d54c0607dffd8fa082 100644 (file)
@@ -123,6 +123,7 @@ struct rpc_xprt {
        unsigned long           cwnd;           /* congestion window */
 
        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   backlog;        /* waiting for slot */
        struct rpc_rqst *       free;           /* free slots */
index 1c50e4fbf8a67ed7f655262f1a32347a3f54e5f3..fc3bb3841329963ea83e90d29f5bbbb3a6ae6798 100644 (file)
@@ -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_timeout = 0;
                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;
        spin_unlock_bh(&xprt->sock_lock);
@@ -166,9 +169,12 @@ __xprt_lock_write_next(struct rpc_xprt *xprt)
                return;
        if (!xprt->nocong && RPCXPRT_CONGESTED(xprt))
                return;
-       task = rpc_wake_up_next(&xprt->sending);
-       if (!task)
-               return;
+       task = rpc_wake_up_next(&xprt->resend);
+       if (!task) {
+               task = rpc_wake_up_next(&xprt->sending);
+               if (!task)
+                       return;
+       }
        if (xprt->nocong || __xprt_get_cong(xprt, task))
                xprt->snd_task = task;
 }
@@ -1346,6 +1352,7 @@ xprt_setup(struct socket *sock, int proto,
 
        INIT_RPC_WAITQ(&xprt->pending, "xprt_pending");
        INIT_RPC_WAITQ(&xprt->sending, "xprt_sending");
+       INIT_RPC_WAITQ(&xprt->resend, "xprt_resend");
        INIT_RPC_WAITQ(&xprt->backlog, "xprt_backlog");
 
        /* initialize free list */
@@ -1477,6 +1484,7 @@ xprt_shutdown(struct rpc_xprt *xprt)
 {
        xprt->shutdown = 1;
        rpc_wake_up(&xprt->sending);
+       rpc_wake_up(&xprt->resend);
        rpc_wake_up(&xprt->pending);
        rpc_wake_up(&xprt->backlog);
        if (waitqueue_active(&xprt->cong_wait))