Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1285542ybi; Thu, 30 May 2019 14:56:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwG6D24HdoqC/+IC5QgDI09MNxyxUyyOfNbyL5+l6ImPG4GEnW091MJppVjMHexlJv4Q9Pc X-Received: by 2002:a62:2643:: with SMTP id m64mr5798509pfm.46.1559253396301; Thu, 30 May 2019 14:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559253396; cv=none; d=google.com; s=arc-20160816; b=qk0OP9JYM94dTzAtSKMh6WIBcwFX8C3UFsTMipltRhiXWll1terPiQCFinB7soVj4O 3uQCTD0HicmyC9AcJfhsie2vey+SGLivtuCPRsf6NHB5xUfe7N/KfGd9kET1oFjDZ3Bp Pt0F30TJ36iY02+RXkE1E6JXPW/+R8p47LbP3ur+6HBPcDUtMaBL5tElGwKtbBGyszGp 58nBs5uafTUOci5Y9KdCITomWt3N2f5PFnXQKgTPDBnKQnclZxIjVwFUkCVdyEfRpNRk Gv2R1fwJz0HQEfWxRZj/0M3Nk9NZLM0Kmkx6H/SHPzhD3N13n72wvt7yN0nOXvWR76Xm sA6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date; bh=MW7IiTNsSij3OSMT81NQ2REMEfVm/poDai5AeLwuhS8=; b=MTcXMXrkjFimXtQQaq2IUJKifg0kGa7CCRwM8G68onuV5KA6rwwReOj+Uxtw5sX5rU F+pr4uPR5UH2PhNoLu+BCAfIFzCs+e37a1oK8hXB+OHp5pJnLCbsTTDKuWWacuXB8u7I WegugdxxjW20nB72wzTj5XfEhYAxCqP/C8/kkczJNSaBQaoAPUp5HmcXJMi1hEnu9BeO uWclPQhgvKn3efftiTVguqPYB8rQ8WeRmer/wJmhMqT6VEOFLiHhCCvzfh2C1UVBiM3H 4ww6CydQ0LdnsaccKs02Za0ryvWibC6sx0TyBfMZE5iZVhVEvHHJzsjHhMKRKaNkldVv LNfA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l70si4309785pjb.33.2019.05.30.14.56.04; Thu, 30 May 2019 14:56:36 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727021AbfE3Vyn (ORCPT + 99 others); Thu, 30 May 2019 17:54:43 -0400 Received: from fieldses.org ([173.255.197.46]:41232 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726986AbfE3Vyk (ORCPT ); Thu, 30 May 2019 17:54:40 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 4D5ED1E29; Thu, 30 May 2019 17:38:57 -0400 (EDT) Date: Thu, 30 May 2019 17:38:57 -0400 To: Dave Wysochanski Cc: linux-nfs@vger.kernel.org Subject: Re: [PATCH 3/3] SUNRPC: Count ops completing with tk_status < 0 Message-ID: <20190530213857.GA24802@fieldses.org> References: <20190523201351.12232-1-dwysocha@redhat.com> <20190523201351.12232-3-dwysocha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190523201351.12232-3-dwysocha@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, May 23, 2019 at 04:13:50PM -0400, Dave Wysochanski wrote: > We often see various error conditions with NFS4.x that show up with > a very high operation count all completing with tk_status < 0 in a > short period of time. Add a count to rpc_iostats to record on a > per-op basis the ops that complete in this manner, which will > enable lower overhead diagnostics. Looks like a good idea to me. It's too bad we can't distinguish the errors. (E.g. ESTALE on a lookup call is a lot more interesting than ENOENT.) But understood that maintaining (number of possible errors) * (number of possible ops) counters is probably overkill, so just counting the number of errors seems like a good start. --b. > > Signed-off-by: Dave Wysochanski > --- > include/linux/sunrpc/metrics.h | 7 ++++++- > net/sunrpc/stats.c | 8 ++++++-- > 2 files changed, 12 insertions(+), 3 deletions(-) > > diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h > index 1b3751327575..0ee3f7052846 100644 > --- a/include/linux/sunrpc/metrics.h > +++ b/include/linux/sunrpc/metrics.h > @@ -30,7 +30,7 @@ > #include > #include > > -#define RPC_IOSTATS_VERS "1.0" > +#define RPC_IOSTATS_VERS "1.1" > > struct rpc_iostats { > spinlock_t om_lock; > @@ -66,6 +66,11 @@ struct rpc_iostats { > ktime_t om_queue, /* queued for xmit */ > om_rtt, /* RPC RTT */ > om_execute; /* RPC execution */ > + /* > + * The count of operations that complete with tk_status < 0. > + * These statuses usually indicate error conditions. > + */ > + unsigned long om_error_status; > } ____cacheline_aligned; > > struct rpc_task; > diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c > index 8b2d3c58ffae..737414247ca7 100644 > --- a/net/sunrpc/stats.c > +++ b/net/sunrpc/stats.c > @@ -176,6 +176,8 @@ void rpc_count_iostats_metrics(const struct rpc_task *task, > > execute = ktime_sub(now, task->tk_start); > op_metrics->om_execute = ktime_add(op_metrics->om_execute, execute); > + if (task->tk_status < 0) > + op_metrics->om_error_status++; > > spin_unlock(&op_metrics->om_lock); > > @@ -218,13 +220,14 @@ static void _add_rpc_iostats(struct rpc_iostats *a, struct rpc_iostats *b) > a->om_queue = ktime_add(a->om_queue, b->om_queue); > a->om_rtt = ktime_add(a->om_rtt, b->om_rtt); > a->om_execute = ktime_add(a->om_execute, b->om_execute); > + a->om_error_status += b->om_error_status; > } > > static void _print_rpc_iostats(struct seq_file *seq, struct rpc_iostats *stats, > int op, const struct rpc_procinfo *procs) > { > _print_name(seq, op, procs); > - seq_printf(seq, "%lu %lu %lu %llu %llu %llu %llu %llu\n", > + seq_printf(seq, "%lu %lu %lu %llu %llu %llu %llu %llu %lu\n", > stats->om_ops, > stats->om_ntrans, > stats->om_timeouts, > @@ -232,7 +235,8 @@ static void _print_rpc_iostats(struct seq_file *seq, struct rpc_iostats *stats, > stats->om_bytes_recv, > ktime_to_ms(stats->om_queue), > ktime_to_ms(stats->om_rtt), > - ktime_to_ms(stats->om_execute)); > + ktime_to_ms(stats->om_execute), > + stats->om_error_status); > } > > void rpc_clnt_show_stats(struct seq_file *seq, struct rpc_clnt *clnt) > -- > 2.20.1