mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chuck Lever" <cel@kernel.org>
To: "Jeff Layton" <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
	"Olga Kornievskaia" <okorniev@redhat.com>,
	"Dai Ngo" <Dai.Ngo@oracle.com>, "Tom Talpey" <tom@talpey.com>
Cc: "Trond Myklebust" <trondmy@kernel.org>,
	"Anna Schumaker" <anna@kernel.org>,
	"Steve Dickson" <steved@redhat.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 6/6] nfsd: export NFSv4 callback op stats via netlink
Date: Thu, 18 Jun 2026 20:17:12 -0400	[thread overview]
Message-ID: <73060044-e8fd-4944-83e7-497e1355332e@app.fastmail.com> (raw)
In-Reply-To: <20260618-exportd-netlink-v5-6-e9aef947af3d@kernel.org>



On Thu, Jun 18, 2026, at 12:58 PM, Jeff Layton wrote:
> Add a proc4cb-ops nested attribute to the server-stats netlink dump,
> reusing the existing server-proc-entry (op/count) layout. The first dump
> message emits one entry per callback opcode (OP_CB_GETATTR..OP_CB_OFFLOAD)
> from the per-netns callback counters; the set is small and fits alongside
> the scalar stats, so no extra paging is needed.
>
> This lets nfsstat report NFSv4 backchannel operation counts over netlink,
> including CB_GETATTR which corresponds to the procfs wdeleg_getattr line.
>
> Assisted-by: Claude:claude-opus-4-8
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  Documentation/netlink/specs/nfsd.yaml |  6 ++++++
>  fs/nfsd/nfsctl.c                      | 23 +++++++++++++++++++++++
>  include/uapi/linux/nfsd_netlink.h     |  1 +
>  3 files changed, 30 insertions(+)

> diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> index 9bedbe7096c3..674fab6a86a5 100644
> --- a/fs/nfsd/nfsctl.c
> +++ b/fs/nfsd/nfsctl.c
> @@ -2476,6 +2476,29 @@ int nfsd_nl_server_stats_get_dumpit(struct sk_buff *skb,
>  			}
>  		}
> 
> +#ifdef CONFIG_NFSD_V4
> +		/* NFSv4 callback (backchannel) per-operation counts */
> +		for (int op = OP_CB_GETATTR; op <= OP_CB_OFFLOAD; op++) {
> +			struct nlattr *nest;
> +			u64 cnt;
> +
> +			cnt = percpu_counter_sum_positive(
> +				&nn->cb_counter[op]);

The loop emits an entry for every opcode in OP_CB_GETATTR..OP_CB_OFFLOAD,
but only opcodes with a nfsd4_callback_ops instance get incremented (via
nfsd4_run_cb() keyed on cb->cb_ops->opcode). Opcodes nfsd never sends
correctly report 0. The exception is op 11 / CB_SEQUENCE: it's written by
encode_cb_sequence4args() on every minorversion>0 callback, so it goes
out on the wire but is never counted. The dump always shows op 11 with
count 0, which could be misread as "none sent" rather than "not tracked."

Check what the forechannel counter does for SEQUENCE operations.


-- 
Chuck Lever

      reply	other threads:[~2026-06-19  0:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 16:57 [PATCH v5 0/6] nfsd/sunrpc: convert nfsstat server-side interfaces to use netlink Jeff Layton
2026-06-18 16:57 ` [PATCH v5 1/6] sunrpc: add per-netns per-procedure call counts to svc_stat Jeff Layton
2026-06-18 16:57 ` [PATCH v5 2/6] sunrpc: use per-net counts in svc_seq_show() Jeff Layton
2026-06-18 16:57 ` [PATCH v5 3/6] nfsd: implement server-stats-get netlink handler Jeff Layton
2026-06-18 16:57 ` [PATCH v5 4/6] sunrpc: remove unused svc_version vs_count field Jeff Layton
2026-06-18 16:57 ` [PATCH v5 5/6] nfsd: count NFSv4 callback operations per netns Jeff Layton
2026-06-19  0:12   ` Chuck Lever
2026-06-18 16:58 ` [PATCH v5 6/6] nfsd: export NFSv4 callback op stats via netlink Jeff Layton
2026-06-19  0:17   ` Chuck Lever [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73060044-e8fd-4944-83e7-497e1355332e@app.fastmail.com \
    --to=cel@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=anna@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=steved@redhat.com \
    --cc=tom@talpey.com \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome