SUNRPC: requeue tcp socket less frequently
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 18 May 2009 21:47:56 +0000 (17:47 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 7 Apr 2011 18:36:39 +0000 (14:36 -0400)
Don't requeue the socket in some cases where we know it's unnecessary.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/svcsock.c

index b7d435c3f19ec537275cb8b413d6c929c4dc8fa6..7a3e4bfd895dd2d8d5e38db96886a95d9bb3e4b0 100644 (file)
@@ -965,7 +965,6 @@ static int svc_tcp_recv_record(struct svc_sock *svsk, struct svc_rqst *rqstp)
                goto err_again; /* record not complete */
        }
        len = svsk->sk_reclen;
-       set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
 
        return len;
  error:
@@ -1115,6 +1114,10 @@ out:
        /* Reset TCP read info */
        svsk->sk_reclen = 0;
        svsk->sk_tcplen = 0;
+       /* If we have more data, signal svc_xprt_enqueue() to try again */
+       if (svc_recv_available(svsk) > sizeof(rpc_fraghdr))
+               set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
+
 
        svc_xprt_copy_addrs(rqstp, &svsk->sk_xprt);
        if (serv->sv_stats)