Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5026679rwb; Tue, 8 Aug 2023 19:11:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdTpDbfiTp5DcH2rB+DV9+zjl8Kq6JBVF0+8JNFQHAFdrbkytJUlMiLfAvlU/4ZiEbcmil X-Received: by 2002:a17:90b:3654:b0:262:fa59:2908 with SMTP id nh20-20020a17090b365400b00262fa592908mr14361450pjb.1.1691547073400; Tue, 08 Aug 2023 19:11:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691547073; cv=none; d=google.com; s=arc-20160816; b=Z0ktNup0+2bSf7CJtQOlsSnzL3QQbaZ5usi5aRLJbeu78nZOd2PusWeydso5E8t/yt pA7O6UDtTD/gUYSpkl//7jbsGGGTBZ7F8KwyJb/96yWqJ9s/AI49+SrymPrFO6F//Gsu rMVaAIGtE8JUaVSJRcMCa1XORZ6DrNu19bjxx9lQ+dZcrMXm9rh1pkVNM+9+ys/6nj9q o6v1rvP9V2RzWqPQATTQbGrIx7A0e9992a3D5k29cv4tIy+kblRr/AGp+qC5W745A9wT 4IIRlUv1ZkNBaFXMSypDklwQdsGbkDzOg2ak/gZ2ZwjzVdmZ4/dkNiUY/BroiF8e/k7a u+zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=3lY5HR9Vtr8aTUv2TNXnfYgpmvZQfZPQdJ+ZCpwW4/4=; fh=KapfTEmF3/Vz8NK0RGHEhZGyPOpV0kwgStbWLnmMjOw=; b=tMncyV3GHTob7wxkrhBMn0RwT0DBLrIhDxiIGN1fePQPEOZbeHTAdl66ODkYYiOMri tfek9heALrZwUi1+dhjpuRO0WOnWvhCCksiT3k1KpxzAL3y9sXQf3yyKHBq/0dzl/1bQ r68NgwBmOR0l57GzBUYRTH5UjGvqUSvsH6Oo/m8POHPAbhMPWh3YDdsExe/z0949vtc1 kPCdjt65aXh9/wYupjB41Lg2qoUcatD8I2e98OOK4WbCko+5kOZsMw830BFpGdxMB353 h+/r8J8vA3jIXfh9/sffSvRialg77jQ+a3AdlfUxOONhD3pZwzGyRHYQKellICwGpsWq sjzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=aKZ0ncA9; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t6-20020a63b246000000b0053f265b0eecsi3619073pgo.133.2023.08.08.19.10.53; Tue, 08 Aug 2023 19:11:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=aKZ0ncA9; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230153AbjHIBaJ (ORCPT + 99 others); Tue, 8 Aug 2023 21:30:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229914AbjHIBaI (ORCPT ); Tue, 8 Aug 2023 21:30:08 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B3831BDA for ; Tue, 8 Aug 2023 18:30:04 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A72061F45F; Wed, 9 Aug 2023 01:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1691544602; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3lY5HR9Vtr8aTUv2TNXnfYgpmvZQfZPQdJ+ZCpwW4/4=; b=aKZ0ncA9O6WvEGAYujdwXG6eAf7A83eXKNHfiAeby1os/wfbyCav0MfeGATqn5olafJsPV auqCr4OUkLKhrE+JMWb2PPvMVaxt0vTnbu5Bajaft+8KjH+JIpS4Wz/hnHcsrlUC1AsA76 UVEw6vOkl6pcrSHENxLuyTpi4whLQR8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1691544602; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3lY5HR9Vtr8aTUv2TNXnfYgpmvZQfZPQdJ+ZCpwW4/4=; b=E72UE+hZ9aIBfwMdSm/+baRMpifMfSDx4GNW3tXhXcA7nhxgO+dfz1DDXav+8Gec643N/G CdIXzTWT13V1/aBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C9B691377F; Wed, 9 Aug 2023 01:30:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Zq1wHhjs0mSvSQAAMHmgww (envelope-from ); Wed, 09 Aug 2023 01:30:00 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Chuck Lever" Cc: "Jeff Layton" , "Lorenzo Bianconi" , linux-nfs@vger.kernel.org, lorenzo.bianconi@redhat.com Subject: Re: [PATCH] NFSD: add version field to nfsd_rpc_status_show handler In-reply-to: References: <6431d0ea2295a1e128f83cd76a419dee161e4c44.1691482815.git.lorenzo@kernel.org>, <169149440399.32308.1010201101079709026@noble.neil.brown.name>, , , , , , <169153110624.32308.3596310364486971122@noble.neil.brown.name>, Date: Wed, 09 Aug 2023 11:29:57 +1000 Message-id: <169154459718.32308.4071940535265083664@noble.neil.brown.name> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, 09 Aug 2023, Chuck Lever wrote: > On Wed, Aug 09, 2023 at 07:45:06AM +1000, NeilBrown wrote: > > On Wed, 09 Aug 2023, Chuck Lever wrote: > > > On Tue, Aug 08, 2023 at 10:20:44AM -0400, Jeff Layton wrote: > > > > > > > > It would probably be fairly simple to output well-formed yaml instead. > > > > JSON and XML are a bit more of a pain. > > > > > > If folks don't mind, I would like more structured output like one of > > > these self-documenting formats. (I know I said I didn't care before, > > > but I'm beginning to care now ;-) > > > > Lustre, which I am somewhat involved with, uses YAML for various things. > > If someone else introduced yaml-producing sysfs files to the kernel > > first, that might make the path for lustre smoother :-) > > It worries me that there isn't yet kernel infrastructure for > formating yaml in sysfs files. That broadens the scope of this > work significantly. > > > > Another option is netlink which lustre is stating to use for > > configuration and stats. It is a self-describing format. The code > > looks verbose, but it is widely used in the kernel and so well supported. > > I just spent the last 6 months building a netlink upcall to handle > TLS handshake requests for in-kernel TLS consumers. It is built on > the recently-added yaml netlink specs and code generator. The yaml > netlink specs are kept under: > > Documentation/netlink/specs/ > > Using netlink would give us a lot of infrastructure for this > facility, but I'm not sure it's worth the extra complexity. And it > would /require/ the use of user space tooling (ie, not 'cat') to get > to the information exported from the kernel. > I do like the "cat" approach. Unfortunately it doesn't scale and you never really know when it needs to scale. The nfsd/rpc cache.c auth cache is still a sore point for me. It works nicely expect that it breaks for gss because the keys get too big. So we've had a couple of attempts to "fix" that. The fixes work, but they are *different*. The other well known pain point is /proc/mounts. It is really cool that you can "cat" that, but with thousands of mounts it can take tools like systemd a long time to find changes. does any of that matter for collecting stats? Will we hit a wall? I really don't know. I'd like to think that we won't.... > > > > I'm also wondering if we really ought not add another file under > > > /proc, which is essentially obsolete. Would /sys/fs/nfsd/yada be > > > better for this facility? > > > > It is only under /proc because that is where it is mounted by default :-) > > I think it might be sensible to create a node under /sys where all the > > content of the nfsd filesystem also appears. > > There are things in the nfsd filesystem that really belong under > /proc/net/rpc or elsewhere, so IMO such migration needs to be > handled on a case-by-case basis -- different project for another > time. abolutely. > > > > I'm not keen on /sys/fs/nfsd because nfsd isn't a filesystem, it is a > > service. > > How about /sys/module/nfsd ? Not worse than /sys/fs/nfsd. Not really better though. Everything in /sys/module/foo is about the module as a chunk of code - except "parameters". I guess we could add "state". Maybe configfs is the thing ... but I never liked configfs. It seems like a solution in search of a problem. I complained that /sys/fs is like the provfs-v2. It is more that everything other than devices (and block,bus,class) is procfs-v2. There are little bits of regularity, but no big-picture. I would probably argue for /sys/services/sunrpc/{nfsd,lockd,nfsv4.1-cb} Alternately, we could go for /sys/devices/virtual/sunrpc. The virtual directory contains "workqueue" which is a service in some sense, and contains subdirectories for specific work-queues. I'm not sure that all of the nfsd stuff would fit under there... but maybe I'm over-thinking things. Thanks, NeilBrown > > > > > I hesitate to even mention network namespaces... > > > > Please do mention them - I find them too easy to forget about. > > /proc/fs/nfsd/ inherits the network namespace from whoever mounts it. > > So this can work perfectly. > > If we created a mirror in /sys/ we would presumably use the namespace of > > the process that opens the file. > > I agree: the network namespace of the process that opens the > rpc_status file is just what we want to limit access to in-flight > requests. The current network namespace of each thread is available > via SVC_NET(rqst), so it should be quite simple to display only > in-flight requests that match the opener's namespace. > > > -- > Chuck Lever >