From patchwork Tue Sep 4 21:05:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 10587917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D0DD112B for ; Tue, 4 Sep 2018 21:06:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F2B229FC2 for ; Tue, 4 Sep 2018 21:06:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 137B62A105; Tue, 4 Sep 2018 21:06:27 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 A496F2A0B9 for ; Tue, 4 Sep 2018 21:06:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726512AbeIEBdN (ORCPT ); Tue, 4 Sep 2018 21:33:13 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:37962 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbeIEBdN (ORCPT ); Tue, 4 Sep 2018 21:33:13 -0400 Received: by mail-it0-f65.google.com with SMTP id p129-v6so6701602ite.3 for ; Tue, 04 Sep 2018 14:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=m6hO7PEwM712wpf4GaIYEf4yujzYDu4fWHLp5v28WQA=; b=Ld8dWnTER8Z9xdYGp6ZjvCwOJDaOAPmUS/apESkbhyLXwNuGSvZ2xyZa7PpfZ0yLwP dNV0KIwEB0iMT/Nw3iKUrxHFZUEYGQpffy+aRjQzLA+w2qYqy33cENWQ1+8C77aNk5sZ 8V1KNf/MNAtBHZf+bnhNCeISNR/GI+oCpx9BK49U9DVhqOdaTYzlYl6yB5JL7Esg0Dbr e+/KFpd7BQq/LwESDm4G7sFfEG6wn588XK/aE3fmZAoeRNVEO5cwFFyvHUtu1ienD7s2 Ao5H1gSSiwcsm3KctSiJ7g2vVPr2bRFqFjmasUgp8Q4ii/12hxBPXwOOazGdlUNMvqQB Z6Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m6hO7PEwM712wpf4GaIYEf4yujzYDu4fWHLp5v28WQA=; b=O84BZytxzONOu4rkvxnX8r7WghtePTWjXRSOOBqmvkKdlwI5a2e2zuz+VOC+oVgtD5 h9cmBaHJVIH7q5Cn5uGp8p8+LAq2bDi2aFWx69E305njxmDEYF7p9jkqmie/CAZzANQp yzBIXzbUW1UrAhW4g6cNT2A1HA+XWeCvZztW8KrC5xn5u4Ne/nMbiUxLfxQ9QNqKGeAq xWbsRCJn6SOZf8q1zEYSCevXlaaHFHmq51+ugNI33GsCiYmUB4y2G7yCj76DgDaGVTBN RMI1RLjcyJXHoFz3iBfYCkh75AT3X1/dTfyujrc+SJlGMT8LyY2kRJAQllQCevWWwUXr Sj/A== X-Gm-Message-State: APzg51DiSrYrg4A5gRVFCnqm3896iRvqi5iKWfjHEEM6Rlu9xase7fJN Ovq250H+BRyhPf2kdr6ZRH3J/2o= X-Google-Smtp-Source: ANB0Vdbp3yukeiwGTNhjQGfY4yjViapwH2hGx6vUvqvEPI2xhJyO034+GnBkcYqjAQw/99ww5LxljA== X-Received: by 2002:a24:c984:: with SMTP id h126-v6mr1605733itg.33.1536095180377; Tue, 04 Sep 2018 14:06:20 -0700 (PDT) Received: from leira.trondhjem.org.localdomain (c-68-40-195-73.hsd1.mi.comcast.net. [68.40.195.73]) by smtp.gmail.com with ESMTPSA id t64-v6sm172860ita.13.2018.09.04.14.06.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Sep 2018 14:06:19 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH v2 12/34] SUNRPC: Don't wake queued RPC calls multiple times in xprt_transmit Date: Tue, 4 Sep 2018 17:05:27 -0400 Message-Id: <20180904210549.81673-13-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180904210549.81673-12-trond.myklebust@hammerspace.com> References: <20180904210549.81673-1-trond.myklebust@hammerspace.com> <20180904210549.81673-2-trond.myklebust@hammerspace.com> <20180904210549.81673-3-trond.myklebust@hammerspace.com> <20180904210549.81673-4-trond.myklebust@hammerspace.com> <20180904210549.81673-5-trond.myklebust@hammerspace.com> <20180904210549.81673-6-trond.myklebust@hammerspace.com> <20180904210549.81673-7-trond.myklebust@hammerspace.com> <20180904210549.81673-8-trond.myklebust@hammerspace.com> <20180904210549.81673-9-trond.myklebust@hammerspace.com> <20180904210549.81673-10-trond.myklebust@hammerspace.com> <20180904210549.81673-11-trond.myklebust@hammerspace.com> <20180904210549.81673-12-trond.myklebust@hammerspace.com> MIME-Version: 1.0 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 Rather than waking up the entire queue of RPC messages a second time, just wake up the task that was put to sleep. Signed-off-by: Trond Myklebust --- net/sunrpc/xprt.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index bf8fc1a5dbd1..0441e6c8153d 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1075,13 +1075,10 @@ void xprt_transmit(struct rpc_task *task) spin_lock(&xprt->recv_lock); if (test_bit(RPC_TASK_NEED_RECV, &task->tk_runstate)) { rpc_sleep_on(&xprt->pending, task, xprt_timer); - /* - * Send an extra queue wakeup call if the - * connection was dropped in case the call to - * rpc_sleep_on() raced. - */ + /* Wake up immediately if the connection was dropped */ if (!xprt_connected(xprt)) - xprt_wake_pending_tasks(xprt, -ENOTCONN); + rpc_wake_up_queued_task_set_status(&xprt->pending, + task, -ENOTCONN); } spin_unlock(&xprt->recv_lock); }