Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2214190ybm; Thu, 23 May 2019 13:14:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzn7hTCwaUqE1TQt+p1pkAc6o5q8LfSuOw/sIjjJFDtEMdP8ybwj3471H+lyiaA+kZ01cF0 X-Received: by 2002:a17:90b:8d7:: with SMTP id ds23mr3901572pjb.138.1558642475114; Thu, 23 May 2019 13:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558642475; cv=none; d=google.com; s=arc-20160816; b=NfjJAtsZj5DTbGid6RkJfG/SeurqI2Z/fmgQfaIkLCm/M/sosA6ViPgW8w77jPc2c8 GKqs4z1cIuyfVVrVMHVXU/Pj5Matt+pZ6/yxJZUUFSD1CaDXdy3akkOrvUwhZc2KobBi FA7J2dTkbXhgmzcOdkzkmLUsYZDSIr/x+IulCuhFJgVpGEVQpNUwK1us60EaLu8ksYr5 LbAsCyg/hU+QEFm1uU6YJnm4GR4hmiYbZ1xIdgsavxsJMArv6A7sQgkemAOufEtj4iYg HmkHydM3ytfN3/zQ4ujMLEcFOHRcBHtk3FGOVSu71mwtAHpbKP7baCZcbDQGi5tgvfwq vPuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=yqUKTZLSwDXsOM0Z8klU9v849zulwGHMJoobQ+bWlRU=; b=pT94vkpXpGCE077Dhw4jv8JmdI48pVgsedMRC7ZjIbDs+NJa5Vl5zQGqe7FRiPoRm5 KnipPJtLXeszn/yeH0DeJxjQLvGLryZqPvIGm0r9GzBbOHkvWscqyKwby/3ugPZuNQPq A8zwzS9CuXkNwdDgKEyiPxvjEVcFG+n7peczQAQcLgKeGvzrmHBOo+Gpetf6ONXspaQY q+CfLH8ejcRi2HHDtbsxL0brrOvk1N+syY+ukzMJHdRI6ddMP4Ec/94rtJ5IclMWgIrS rsHTT3imEFYw2uS6g0li/6xawvxtATUVooMNWQ94cWykgRcGTMo8rHVjTEGjerQwKpyr ZKQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7si804118pgt.106.2019.05.23.13.14.09; Thu, 23 May 2019 13:14:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731551AbfEWUOH (ORCPT + 99 others); Thu, 23 May 2019 16:14:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42240 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbfEWUOH (ORCPT ); Thu, 23 May 2019 16:14:07 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E07EADF26 for ; Thu, 23 May 2019 20:14:06 +0000 (UTC) Received: from f29-node1.dwysocha.net (dhcp145-42.rdu.redhat.com [10.13.145.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id B52C26012C for ; Thu, 23 May 2019 20:14:06 +0000 (UTC) From: Dave Wysochanski To: linux-nfs@vger.kernel.org Subject: [PATCH 1/3] SUNRPC: Move call to rpc_count_iostats before rpc_call_done Date: Thu, 23 May 2019 16:13:48 -0400 Message-Id: <20190523201351.12232-1-dwysocha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 23 May 2019 20:14:06 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org For diagnostic purposes, it would be useful to have an rpc_iostats metric of RPCs completing with tk_status < 0. Unfortunately, tk_status is reset inside the rpc_call_done functions for each operation, and the call to tally the per-op metrics comes after rpc_call_done. Refactor the call to rpc_count_iostat earlier in rpc_exit_task so we can count these RPCs completing in error. Signed-off-by: Dave Wysochanski --- net/sunrpc/sched.c | 5 +++++ net/sunrpc/xprt.c | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index 28956c70100a..543caef296e4 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -22,6 +22,7 @@ #include #include +#include #include "sunrpc.h" @@ -770,6 +771,10 @@ rpc_reset_task_statistics(struct rpc_task *task) void rpc_exit_task(struct rpc_task *task) { task->tk_action = NULL; + if (task->tk_ops->rpc_count_stats) + task->tk_ops->rpc_count_stats(task, task->tk_calldata); + else if (task->tk_client) + rpc_count_iostats(task, task->tk_client->cl_metrics); if (task->tk_ops->rpc_call_done != NULL) { task->tk_ops->rpc_call_done(task, task->tk_calldata); if (task->tk_action != NULL) { diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index d7117d241460..d4477b227a96 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1716,10 +1716,6 @@ void xprt_release(struct rpc_task *task) } xprt = req->rq_xprt; - if (task->tk_ops->rpc_count_stats != NULL) - task->tk_ops->rpc_count_stats(task, task->tk_calldata); - else if (task->tk_client) - rpc_count_iostats(task, task->tk_client->cl_metrics); xprt_request_dequeue_all(task, req); spin_lock_bh(&xprt->transport_lock); xprt->ops->release_xprt(xprt, task); -- 2.20.1