Return-Path: Received: from mail-it0-f49.google.com ([209.85.214.49]:34574 "EHLO mail-it0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727389AbeICTuu (ORCPT ); Mon, 3 Sep 2018 15:50:50 -0400 Received: by mail-it0-f49.google.com with SMTP id x79-v6so11545371ita.1 for ; Mon, 03 Sep 2018 08:30:11 -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 c25-v6sm7040027iob.30.2018.09.03.08.30.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 08:30:09 -0700 (PDT) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH 12/27] SUNRPC: Don't wake queued RPC calls multiple times in xprt_transmit Date: Mon, 3 Sep 2018 11:29:21 -0400 Message-Id: <20180903152936.24325-13-trond.myklebust@hammerspace.com> In-Reply-To: <20180903152936.24325-12-trond.myklebust@hammerspace.com> References: <20180903152936.24325-1-trond.myklebust@hammerspace.com> <20180903152936.24325-2-trond.myklebust@hammerspace.com> <20180903152936.24325-3-trond.myklebust@hammerspace.com> <20180903152936.24325-4-trond.myklebust@hammerspace.com> <20180903152936.24325-5-trond.myklebust@hammerspace.com> <20180903152936.24325-6-trond.myklebust@hammerspace.com> <20180903152936.24325-7-trond.myklebust@hammerspace.com> <20180903152936.24325-8-trond.myklebust@hammerspace.com> <20180903152936.24325-9-trond.myklebust@hammerspace.com> <20180903152936.24325-10-trond.myklebust@hammerspace.com> <20180903152936.24325-11-trond.myklebust@hammerspace.com> <20180903152936.24325-12-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org List-ID: 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); } -- 2.17.1