From patchwork Tue Nov 14 23:06:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Watt X-Patchwork-Id: 10058539 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 12BF360215 for ; Tue, 14 Nov 2017 23:06:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05D7829AA7 for ; Tue, 14 Nov 2017 23:06:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE8DF29AB2; Tue, 14 Nov 2017 23:06:41 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 A207029AAD for ; Tue, 14 Nov 2017 23:06:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756484AbdKNXGk (ORCPT ); Tue, 14 Nov 2017 18:06:40 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:57031 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756463AbdKNXGi (ORCPT ); Tue, 14 Nov 2017 18:06:38 -0500 Received: by mail-it0-f65.google.com with SMTP id r127so15586266itb.5 for ; Tue, 14 Nov 2017 15:06:38 -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=atFfxBB7oXvt6ncdLvb7+gV8Xqf4bCF5hMOCsx9fDdg=; b=DDFHLUHEO595lewRJEw9k4fqbOx8MQrqiMCoBkCug4lZ4lZqDYtC+P8vNR//XZ/rz4 baAGUMEXzglduRuNTGhCkH+96YBoTKsdHlusFh9w5p43MScl/NVyOItNp5IBc507xsV2 D98E/W6wGF2QnufjTwDyxwVJ28MjNMsQ/fKMPdUrx5/K3+i6b58fxsySyLUbIdJ07+a9 MvbM6Q+fd2/IsOUmqJmXG4GaiXKYsujOGFOldmqN8fzIEclPgCKaSObCjgNrmpYBjdii PumH8e+XJCqoGWcDubBVD+B6PxnMlFcnEm87nwWeTPi4MouEI9/UFAHUpshLaRkLBjbP V8ag== 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=atFfxBB7oXvt6ncdLvb7+gV8Xqf4bCF5hMOCsx9fDdg=; b=ZXOZg8gN0+ZEBTqpDW0nXqQsmjEHkabs/nl/bhZ4Hxpo/bherqUU1jkohz+hZVsGDV LEmX7Ax9JM0h0PnEhkZcIEHZuFhvpmq/poZRQnqbZhlBRYKFNgdbrPaaEHqef8DdQBlD v/LsM1U5EmD55OJWcLghAAAit0q0tZj1hXMqF6ZNfgkfLokPYL7v1ef+i2EheuHZCFQL 0fIXxq27Kd06eScjriDNUFuXAVKxCm+nVh5nl6+Xkb/0FNTHp+lVlM7GyKywZa9vQoM5 TBvvLbgApgb6FUKrG8scrHFX0U32CtWSg8cZyIidMIgyUHsSXT/A5OLGPgOvMMCHOtOc kHaQ== X-Gm-Message-State: AJaThX7SPIXg6xpbI2JmmhjY+/jKwL9rofXBoGLAp6I0AiRaAygVUGt6 So/+I7LIWIG5xdQhXeRO+RU= X-Google-Smtp-Source: AGs4zMbdZ5Z69gvCLlpt+hJMO2YDEu7YyiOG1KEj8aVbaMXErd5oOsAj9d3QNb4rGAKIFtpxBmqA1A== X-Received: by 10.36.90.81 with SMTP id v78mr17355677ita.114.1510700798350; Tue, 14 Nov 2017 15:06:38 -0800 (PST) Received: from ola-842mrw1.ad.garmin.com ([204.77.163.55]) by smtp.googlemail.com with ESMTPSA id e203sm6015236itb.32.2017.11.14.15.06.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Nov 2017 15:06:37 -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 v3 3/7] SUNRPC: Simplify client shutdown Date: Tue, 14 Nov 2017 17:06:27 -0600 Message-Id: <20171114230631.14682-4-JPEWhacker@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171114230631.14682-1-JPEWhacker@gmail.com> References: <20171114230631.14682-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 ab6b7c59a117..239a7b5ab135 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -851,11 +851,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); }