From patchwork Wed Aug 16 23:00:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 9904705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2F439600CA for ; Wed, 16 Aug 2017 23:01:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2334A28968 for ; Wed, 16 Aug 2017 23:01:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1789D289FF; Wed, 16 Aug 2017 23:01:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83C812898F for ; Wed, 16 Aug 2017 23:01:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752471AbdHPXAR (ORCPT ); Wed, 16 Aug 2017 19:00:17 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:34212 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbdHPXAQ (ORCPT ); Wed, 16 Aug 2017 19:00:16 -0400 Received: by mail-io0-f195.google.com with SMTP id m88so3127718iod.1 for ; Wed, 16 Aug 2017 16:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=VERT7xq7Bb29XI1et0qcXoestrRZAW6Ey5ObfV0yuGg=; b=L8feZ3P6H2lsATTLdwfiy19eebMm+WcEWa5ga1plWb1SGYYScF0NR4Z2CNWBAlamBS Y6qTfLtcdxIqsk4FpQsp9XnrqjO3trKMtjZjF8Y3XAWh96jr37qc16MYjsBIYY39RJEl PtiRD1cUWIa5L/0GeLc0yiiQnhMm82uaZsI3IkL9Ha6P8sZr4vJHPZf5PEwdjFKqBS/n GfbQ3soTNQ9Ly+ZPKlghXJNObUQWaAYD8cix2nGALlyiIou/Gaocnxs72My7hQyriss5 g8NPvbboLkwchDxPdjRdgLbAMZusinCcogrK7l9YSOW0r7ST1xNQiklOScEFkG7f0NLO IrUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=VERT7xq7Bb29XI1et0qcXoestrRZAW6Ey5ObfV0yuGg=; b=WruG67dWzURu51WMIz9A/ujwAcvr9LBzxjH5pvO+Ww3eMvAQORmYNFg8nmYoteVTia HlMZhcE2yHDXluf1c9zr4zd7zqhcsYLGudEUkJsbehiHvdWEk0hLWbaqv9zU+Ytjgj6y HnO8DEM5OSvmQHBF2HRPEO2+TGzO8QYQmuG8Q+X4yORc1WZ/D5YOj2NN/7v9rmaAaz8f /q0F86J3Dm+74+JHlqybFgu6vvSg08I5DKz+q41fliDGF9F1MGW4Y7wv03EXgGj416pP 8XTNarfhvOOuN/EiHaezuu929Hrbaz5RegY1ttVYpFpdmOvCenKX1KPdBDXz2UcML14B D5Ng== X-Gm-Message-State: AHYfb5hcZzAkNWqbsiMV/seriPViyUviQDDcG5YSrb9bXgc/SRsX1G/D DcmX36SJe1xAr10mDXs= X-Received: by 10.107.51.75 with SMTP id z72mr2931942ioz.169.1502924415002; Wed, 16 Aug 2017 16:00:15 -0700 (PDT) Received: from localhost.localdomain (c-68-49-162-121.hsd1.mi.comcast.net. [68.49.162.121]) by smtp.gmail.com with ESMTPSA id q19sm841773iod.10.2017.08.16.16.00.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Aug 2017 16:00:14 -0700 (PDT) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH v3 2/5] SUNRPC: Don't hold the transport lock when receiving backchannel data Date: Wed, 16 Aug 2017 19:00:05 -0400 Message-Id: <20170816230008.20006-3-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170816230008.20006-2-trond.myklebust@primarydata.com> References: <20170816230008.20006-1-trond.myklebust@primarydata.com> <20170816230008.20006-2-trond.myklebust@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The backchannel request has no associated task, so it is going nowhere until we call xprt_complete_bc_request(). Signed-off-by: Trond Myklebust --- net/sunrpc/backchannel_rqst.c | 4 ++-- net/sunrpc/xprtsock.c | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c index ac701c28f44f..c2c68a15b59d 100644 --- a/net/sunrpc/backchannel_rqst.c +++ b/net/sunrpc/backchannel_rqst.c @@ -171,10 +171,10 @@ int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs) /* * Add the temporary list to the backchannel preallocation list */ - spin_lock_bh(&xprt->bc_pa_lock); + spin_lock(&xprt->bc_pa_lock); list_splice(&tmp_list, &xprt->bc_pa_list); xprt_inc_alloc_count(xprt, min_reqs); - spin_unlock_bh(&xprt->bc_pa_lock); + spin_unlock(&xprt->bc_pa_lock); dprintk("RPC: setup backchannel transport done\n"); return 0; diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 04dbc7027712..a2312f14beb4 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -1389,11 +1389,9 @@ static int xs_tcp_read_callback(struct rpc_xprt *xprt, container_of(xprt, struct sock_xprt, xprt); struct rpc_rqst *req; - /* Look up and lock the request corresponding to the given XID */ - spin_lock_bh(&xprt->transport_lock); + /* Look up the request corresponding to the given XID */ req = xprt_lookup_bc_request(xprt, transport->tcp_xid); if (req == NULL) { - spin_unlock_bh(&xprt->transport_lock); printk(KERN_WARNING "Callback slot table overflowed\n"); xprt_force_disconnect(xprt); return -1; @@ -1404,7 +1402,6 @@ static int xs_tcp_read_callback(struct rpc_xprt *xprt, if (!(transport->tcp_flags & TCP_RCV_COPY_DATA)) xprt_complete_bc_request(req, transport->tcp_copied); - spin_unlock_bh(&xprt->transport_lock); return 0; }