From patchwork Mon Sep 3 15:29:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 10586075 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 28D4513BB for ; Mon, 3 Sep 2018 15:30:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19AD029631 for ; Mon, 3 Sep 2018 15:30:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E32929632; Mon, 3 Sep 2018 15:30:13 +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 B89422964F for ; Mon, 3 Sep 2018 15:30:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726314AbeICTuv (ORCPT ); Mon, 3 Sep 2018 15:50:51 -0400 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) 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=uBwR8UpOGH9Nj6ELNm1hYnZzyPqo6fV3NcWoa7Mrz1cZBMPjSg3t+pZI8moKoZTIsy kkRYdpwuc0sHSlUuuPnQfLaaAau9WD/QHwlRx7LGl3qryujqRxnXtc8enYqD8/QWw2Rk IVKdytggofgF5+riaRZA530bNNXcDTKucTeWDhbExmXJS0NF51duTRD+C7vV1y4Rpkkg I0TaMwEni+LFfC4BE7JkicQvKTxwykpNLQG4yTq9U5iTNTRtX3DW7Dm7H0JYnmPQJo2p ameZwtmObi3u9foVJfm9qQXolhE8soQryOiByuwM4B/fGDyBIpMUiBe5E3WUjYnwbX/Z taSw== 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=VYReFxqWEiSG45+gR1jP3lxOCyPXz0p4ponPtMVtKdMfRemM1KidmV6wdHh5t0+GFa HalUDpubLiVkkl7VyBup9+DXKHQOtCXR3k1T8xS/tGL9mAvtcPVOSD9woUrsQeHh7/mb Msu8atvBubAMwZMwpKeoS+Qy4/uz9jKGDF4QrmzhBjzWvJ6egqYQDe8IsgZAPpKWgy9Y tY1BepKffLXOoPbN0BdQE3VmgUuCLF5W44qBkFYRLpaA5zMT+rI80yD0k8+VaBM1S+zd LGH3bmpNHKhSAjNkHexLWM3J3q8729f9A7oCXxYWIZIXxo2RTGQePvDWYeVHelqE1pZ0 Crcw== X-Gm-Message-State: APzg51DRIcL3Ts9ELvuWhTVfl4weAYGZnpjHhxJjwMkrVmDV82M30Bvy Ww2+vcUHpzSW133QbBQ5unER60w= X-Google-Smtp-Source: ANB0VdaSHnI/bDKdJEGDDTygdSjKTByI65UCEPmt5ufemQSrxfrCyaSFDmkoUeeU6IfmK9eV50hkNw== X-Received: by 2002:a24:3c56:: with SMTP id m83-v6mr5369180ita.134.1535988610357; Mon, 03 Sep 2018 08:30:10 -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 X-Google-Original-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> X-Mailer: git-send-email 2.17.1 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 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); }