From patchwork Fri Nov 10 22:37:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Watt X-Patchwork-Id: 10053901 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 C8FE06032D for ; Fri, 10 Nov 2017 22:37:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD8D4223C6 for ; Fri, 10 Nov 2017 22:37:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B26682B4BB; Fri, 10 Nov 2017 22:37:38 +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 5F537223C6 for ; Fri, 10 Nov 2017 22:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754722AbdKJWhg (ORCPT ); Fri, 10 Nov 2017 17:37:36 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:33520 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754707AbdKJWhf (ORCPT ); Fri, 10 Nov 2017 17:37:35 -0500 Received: by mail-it0-f67.google.com with SMTP id n134so4921769itg.0 for ; Fri, 10 Nov 2017 14:37:35 -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=17mUI3DvE2JAGHY8IOnPokNhbUPAnU31Zdnp+6v0tkw=; b=S6TSrt2+O1ktNHqvDGQ1ZE+i3xXW1+8xl5+YH9UOZN12H4MQ7Pe07+W7AQgNVsq3vl +apKT8anvgLagCVp/GikBMqPIwDlUUebfAiSg//ZE/ZCiVvYibq/vGQnWOeZXl0qjsjR LTFoFIJ/qgvXhWq9WunjiXLxl2jHGtZjLWGEol8/UMSMHXBK8QdK8vxLnqNEuvjMYYWE X1d3z1S6HSsaQ2H8GvuB8T9QPqdP8KD/DE67icyAqSqPODMwrl5VV9m3fkXm0vQeK1S7 SgoiUaeXKBph7ecE40M7NVikxvhHIY/n4VVCb38XHstgd3+uMgnAgwhgBjdyah1NPPQP L01g== 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=17mUI3DvE2JAGHY8IOnPokNhbUPAnU31Zdnp+6v0tkw=; b=Cvl5s5QPIUcCWH1EOuyMAdBKqu/ek1K5YMWcOSVVyCthXzoDFo+mCnXP9vK/yvFV+6 sWUVealL6l4vIII1jE7wHfv5gmoe/3WGXe6Foop9Z4ZralIbn6ll7WJMNq85gr105D45 mz1xvaaQXDinqdzn0Ady7viFR4BX0Z24cIhsxG280UMZbegKu9beP25r9wEkaRBPeMfU soSPYyEaF0ZFpys3dVI8qxr1nIIkHhCS9qCTP8SBX2UqkRncq2tnpExFOsx0LdSWSlwa Io61jaHvFDHfM40ooYWkF1jc0+ZjoL+qch83j5E5ZZdCLRJcnkC0wNeEB/j4SZSzszSh GZ/g== X-Gm-Message-State: AJaThX5yHwAkDl85GNf9uVENlLO9cWtqY0Y5d1Kb8nv/nq+YgiACtLh4 sKAV8hKRf4GVw24SPqzhgcA= X-Google-Smtp-Source: AGs4zMYRuc4JH3T3liMfcMunBC7AUFg/gQ0D8Xm4UJIkkga+QnToo2Ys4IdxXZJD879uFKPEH51a5A== X-Received: by 10.36.164.75 with SMTP id v11mr2494838iti.33.1510353455261; Fri, 10 Nov 2017 14:37:35 -0800 (PST) Received: from ola-842mrw1.ad.garmin.com ([204.77.163.55]) by smtp.googlemail.com with ESMTPSA id f3sm5001090iob.70.2017.11.10.14.37.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Nov 2017 14:37:34 -0800 (PST) From: Joshua Watt X-Google-Original-From: Joshua Watt To: NeilBrown , Jeff Layton , Trond Myklebust Cc: linux-nfs@vger.kernel.org, Al Viro , "J . Bruce Fields" , David Howells , Joshua Watt Subject: [RFC v2 3/7] SUNRPC: Simplify client shutdown Date: Fri, 10 Nov 2017 16:37:03 -0600 Message-Id: <20171110223707.17098-4-JPEWhacker@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171110223707.17098-1-JPEWhacker@gmail.com> References: <20171110223707.17098-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 aa64cd667696..b00793c30518 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -850,11 +850,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); - } + clnt->cl_kill_new_tasks = true; + rpc_killall_tasks(clnt); + wait_event(destroy_wait, list_empty(&clnt->cl_tasks)); rpc_release_client(clnt); }