From patchwork Fri Nov 17 17:45:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Watt X-Patchwork-Id: 10063063 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 D5F0E6023A for ; Fri, 17 Nov 2017 17:46:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C55242AD16 for ; Fri, 17 Nov 2017 17:46:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9FB92AD3A; Fri, 17 Nov 2017 17:46:19 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 6C40E2AD16 for ; Fri, 17 Nov 2017 17:46:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161132AbdKQRqS (ORCPT ); Fri, 17 Nov 2017 12:46:18 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:36906 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161134AbdKQRqM (ORCPT ); Fri, 17 Nov 2017 12:46:12 -0500 Received: by mail-it0-f65.google.com with SMTP id m191so4973152itg.2 for ; Fri, 17 Nov 2017 09:46:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QISKUOvbS5Mes+1zk7fpavHyuZlauMg64uGVSvJ0YGg=; b=u/IsxAHxb26aw2018YHV2ZKC68e1xddHf4YMwycKIDN+v5FHPc+EbPZ0DSnh2S59wj TY72VI92CiljzvWqPcTzuIzwte98bwCd2nIkLPrWokhAKEMoM96KMf3JD7P/JORBHEZm 0BT0W8NFG4kcjGAqtAobTjTZQnpUWfLhNMmCOpPPAtEocXFx9+wATGGg3juWdnRdyC5L 1Dh4yli8pNh2fC22FyR86oMDiKVzD9Kecj6m+CTfOU1ABZOktffLzedHxIgPLOArRTfl 9CKS+dG5mm/gNfDmU2I4SpoMryZtD3LvS5QZtrkZAArXGKDgMRZ7UytifQICFFqbIjT2 D//A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QISKUOvbS5Mes+1zk7fpavHyuZlauMg64uGVSvJ0YGg=; b=ETrnArQxEoW04uMLTApCE299dLuqGaC4c/S0+bwwv1dub415F/WpusFNooRLadCrNw UykuhyGZ7aCKdYTw7pRlVkcrexh4chuZwGhskURTX7xjKxu39bua5kmSwjRG/6XIyXGh QvXKfEGjXOehE3JE2ZocTXB2G5V5JH36Ho4fh910nS/DlNw8Ii2Fz4oY1Aq/cPlMhKbf S93AtiCPJg68+5lpmCiu07OHfiecW/cPlUOXJSsjT/eyXIUzKVOeazy7f4TFb+vQo/rY qIUQlMDfztvdBtKYI0QZLDK88/yp6ORz1gLChsbgTbRMDlNlonp39LqqDAV/eHfRWhfb y7zg== X-Gm-Message-State: AJaThX7i4L9NnEdrjUTfohz3vLvRNFi/6Im8Eq5Gpbf5DUEQ7QLdgGZF m5b6xwJ+DOK3n0mjUxNGajw= X-Google-Smtp-Source: AGs4zMbWqTP/XeC1hLVsQ2T1zBtMrCyCETtX70kbDlilNwOFs+/itrj2Pp+3aWVFCMm38vSkl9TnCg== X-Received: by 10.36.103.213 with SMTP id u204mr7442579itc.91.1510940771046; Fri, 17 Nov 2017 09:46:11 -0800 (PST) Received: from ola-842mrw1.ad.garmin.com ([204.77.163.55]) by smtp.googlemail.com with ESMTPSA id h21sm1878189iod.59.2017.11.17.09.46.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Nov 2017 09:46:10 -0800 (PST) From: Joshua Watt X-Google-Original-From: Joshua Watt To: NeilBrown , Jeff Layton , Trond Myklebust , "J . Bruce Fields" Cc: linux-nfs@vger.kernel.org, Al Viro , David Howells , Joshua Watt Subject: [RFC v4 3/9] SUNRPC: Simplify client shutdown Date: Fri, 17 Nov 2017 11:45:46 -0600 Message-Id: <20171117174552.18722-4-JPEWhacker@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171117174552.18722-1-JPEWhacker@gmail.com> References: <20171117174552.18722-1-JPEWhacker@gmail.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 Use the flag to kill all new tasks when shutting down instead of repeatedly killing all the pending tasks. Signed-off-by: Joshua Watt --- net/sunrpc/clnt.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index d5eedabf0b4d..c3abcc800f25 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -852,11 +852,9 @@ void rpc_shutdown_client(struct rpc_clnt *clnt) clnt->cl_program->name, rcu_dereference(clnt->cl_xprt)->servername); - while (!list_empty(&clnt->cl_tasks)) { - rpc_killall_tasks(clnt); - wait_event_timeout(destroy_wait, - list_empty(&clnt->cl_tasks), 1*HZ); - } + atomic_inc(&clnt->cl_kill_new_tasks); + rpc_killall_tasks(clnt); + wait_event(destroy_wait, list_empty(&clnt->cl_tasks)); rpc_release_client(clnt); }