From patchwork Wed Apr 6 23:06:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Fields X-Patchwork-Id: 691211 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p36N6ZxS031146 for ; Wed, 6 Apr 2011 23:06:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756762Ab1DFXGf (ORCPT ); Wed, 6 Apr 2011 19:06:35 -0400 Received: from fieldses.org ([174.143.236.118]:39851 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756968Ab1DFXGd (ORCPT ); Wed, 6 Apr 2011 19:06:33 -0400 Received: from bfields by fieldses.org with local (Exim 4.72) (envelope-from ) id 1Q7bo0-0001j8-AL; Wed, 06 Apr 2011 19:06:32 -0400 From: "J. Bruce Fields" To: linux-nfs@vger.kernel.org Cc: Trond Myklebust , "J. Bruce Fields" Subject: [PATCH 1/7] SUNRPC: requeue tcp socket less frequently Date: Wed, 6 Apr 2011 19:06:20 -0400 Message-Id: <1302131186-6578-2-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1302131186-6578-1-git-send-email-bfields@redhat.com> References: <1302131186-6578-1-git-send-email-bfields@redhat.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 06 Apr 2011 23:06:40 +0000 (UTC) From: Trond Myklebust Don't requeue the socket in some cases where we know it's unnecessary. Signed-off-by: Trond Myklebust Signed-off-by: J. Bruce Fields --- net/sunrpc/svcsock.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index d802e94..29b31df 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -959,7 +959,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: @@ -1109,6 +1108,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)