Make nfsd stats visible in network ns
Subsystems (3)
v3 cover Make nfsd stats visible in network ns
v1: https://lore.kernel.org/linux-nfs/[email protected]/
v2: https://lore.kernel.org/linux-nfs/[email protected]/
NOTE: there's still one nfs change in here and it's where I dropped pg_stats, I assume that's ok for this series, but I can break it out and then follow up with a removal later if necessary.
v2->v3:
- Split out the nfs and nfsd related changes into their own patches.
- Dropped the change adding sv_stats throuch svc_create()
- Changed the th_cnt to be global, re-arranged it's location.
v1->v2:
- rework the sunprc service creation to take a pointer to the sv_stats.
- dropped ->pg_stats from the svc_program.
- converted all of the nfsd global stats to per-network namespace.
- added the ability to point at a specific rpc_stat for rpc program creation.
- converted the rpc stats for nfs to per-network namespace.
Josef Bacik (10):
sunrpc: don't change ->sv_stats if it doesn't exist
nfs: stop setting ->pg_stats for unused stats
sunrpc: pass in the sv_stats struct through svc_create_pooled
sunrpc: remove ->pg_stats from svc_program
sunrpc: use the struct net as the svc proc private
nfsd: rename NFSD_NET_* to NFSD_STATS_*
nfsd: expose /proc/net/sunrpc/nfsd in net namespaces
nfsd: make all of the nfsd stats per-network namespace
nfsd: remove nfsd_stats, make th_cnt a global counter
nfsd: make svc_stat per-network namespace instead of global
fs/lockd/svc.c | 3 -- fs/nfs/callback.c | 3 -- fs/nfsd/cache.h | 2 -- fs/nfsd/netns.h | 25 +++++++++++--- fs/nfsd/nfs4proc.c | 6 ++-- fs/nfsd/nfs4state.c | 3 +- fs/nfsd/nfscache.c | 40 +++++----------------- fs/nfsd/nfsctl.c | 16 ++++----- fs/nfsd/nfsd.h | 1 + fs/nfsd/nfsfh.c | 3 +- fs/nfsd/nfssvc.c | 14 +++----- fs/nfsd/stats.c | 52 ++++++++++++---------------- fs/nfsd/stats.h | 70 +++++++++++++------------------------- fs/nfsd/vfs.c | 5 +-- include/linux/sunrpc/svc.h | 5 ++- net/sunrpc/stats.c | 2 +- net/sunrpc/svc.c | 39 +++++++++++++-------- 17 files changed, 126 insertions(+), 163 deletions(-)
Signature · 1 line
2.43.0
PATCH v3 1/10 sunrpc: don't change ->sv_stats if it doesn't exist
We check for the existence of ->sv_stats elsewhere except in the core processing code. It appears that only nfsd actual exports these values anywhere, everybody else just has a write only copy of sv_stats in their svc_program. Add a check for ->sv_stats before every adjustment to allow us to eliminate the stats struct from all the users who don't report the stats.
--- net/sunrpc/svc.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)
net/sunrpc/svc.c +18 -9
@@ -1375,7 +1375,8 @@ svc_process_common(struct svc_rqst *rqstp) goto err_bad_proc;/* Syntactic check complete */ - serv->sv_stats->rpccnt++; +if (serv->sv_stats) + serv->sv_stats->rpccnt++;trace_svc_process (rqstp, progp->pg_name); aoffset =xdr_stream_pos (xdr);
@@ -1427,7 +1428,8 @@ svc_process_common(struct svc_rqst *rqstp) goto close_xprt; err_bad_rpc: - serv->sv_stats->rpcbadfmt++; +if (serv->sv_stats) + serv->sv_stats->rpcbadfmt++;xdr_stream_encode_u32 (xdr,RPC_MSG_DENIED );xdr_stream_encode_u32 (xdr,RPC_MISMATCH );/* Only RPCv2 supported */
@@ -1438,7 +1440,8 @@ svc_process_common(struct svc_rqst *rqstp) err_bad_auth:dprintk ("svc: authentication failed (%d)\n" ,be32_to_cpu (rqstp->rq_auth_stat)); - serv->sv_stats->rpcbadauth++; +if (serv->sv_stats) + serv->sv_stats->rpcbadauth++;/* Restore write pointer to location of reply status: */ xdr_truncate_encode (xdr,XDR_UNIT *2 );xdr_stream_encode_u32 (xdr,RPC_MSG_DENIED );
@@ -1448,7 +1451,8 @@ svc_process_common(struct svc_rqst *rqstp) err_bad_prog:dprintk ("svc: unknown program %d\n" , rqstp->rq_prog); - serv->sv_stats->rpcbadfmt++; +if (serv->sv_stats) + serv->sv_stats->rpcbadfmt++; *rqstp->rq_accept_statp = rpc_prog_unavail; goto sendit;
@@ -1456,7 +1460,8 @@ svc_process_common(struct svc_rqst *rqstp)svc_printk (rqstp,"unknown version (%d for prog %d, %s)\n" , rqstp->rq_vers, rqstp->rq_prog, progp->pg_name); - serv->sv_stats->rpcbadfmt++; +if (serv->sv_stats) + serv->sv_stats->rpcbadfmt++; *rqstp->rq_accept_statp = rpc_prog_mismatch;/*
@@ -1470,19 +1475,22 @@ svc_process_common(struct svc_rqst *rqstp) err_bad_proc:svc_printk (rqstp,"unknown procedure (%d)\n" , rqstp->rq_proc); - serv->sv_stats->rpcbadfmt++; +if (serv->sv_stats) + serv->sv_stats->rpcbadfmt++; *rqstp->rq_accept_statp = rpc_proc_unavail; goto sendit; err_garbage_args:svc_printk (rqstp,"failed to decode RPC header\n" ); - serv->sv_stats->rpcbadfmt++; +if (serv->sv_stats) + serv->sv_stats->rpcbadfmt++; *rqstp->rq_accept_statp = rpc_garbage_args; goto sendit; err_system_err: - serv->sv_stats->rpcbadfmt++; +if (serv->sv_stats) + serv->sv_stats->rpcbadfmt++; *rqstp->rq_accept_statp = rpc_system_err; goto sendit; }
@@ -1534,7 +1542,8 @@ void svc_process(struct svc_rqst *rqstp) out_baddir:svc_printk (rqstp,"bad direction 0x%08x, dropping request\n" ,be32_to_cpu (*p)); - rqstp->rq_server->sv_stats->rpcbadfmt++; +if (rqstp->rq_server->sv_stats) + rqstp->rq_server->sv_stats->rpcbadfmt++; out_drop:svc_drop (rqstp); }
Signature · 1 line
2.43.0
PATCH v3 2/10 nfs: stop setting ->pg_stats for unused stats
In reply to Josef BacikA lot of places are setting a blank svc_stats in ->pg_stats and never utilizing these stats. Remove all of these extra structs as we're not reporting these stats anywhere.
--- fs/lockd/svc.c | 3 --- fs/nfs/callback.c | 3 --- fs/nfsd/nfssvc.c | 5 ----- 3 files changed, 11 deletions(-)
fs/lockd/svc.c +0 -3
@@ -710,8 +710,6 @@ static const struct svc_version *nlmsvc_version[] = {#endif }; -static struct svc_stat nlmsvc_stats; -#define NLM_NRVERS ARRAY_SIZE(nlmsvc_version)static struct svc_program nlmsvc_program = { .pg_prog =NLM_PROGRAM ,/* program number */
@@ -719,7 +717,6 @@ static struct svc_program nlmsvc_program = { .pg_vers = nlmsvc_version, /* version table */ .pg_name = "lockd", /* service name */ .pg_class = "nfsd", /* share authentication with nfsd */ - .pg_stats = &nlmsvc_stats, /* stats table */ .pg_authenticate = &lockd_authenticate, /* export authentication */ .pg_init_request = svc_generic_init_request, .pg_rpcbind_set = svc_generic_rpcbind_set,
fs/nfs/callback.c +0 -3
@@ -356,15 +356,12 @@ static const struct svc_version *nfs4_callback_version[] = { [4] = &nfs4_callback_version4, }; -static struct svc_stat nfs4_callback_stats; -static struct svc_program nfs4_callback_program = { .pg_prog =NFS4_CALLBACK ,/* RPC service number */ .pg_nvers =ARRAY_SIZE (nfs4_callback_version),/* Number of entries */ .pg_vers = nfs4_callback_version,/* version table */ .pg_name ="NFSv4 callback" ,/* service name */ .pg_class ="nfs" ,/* authentication class */ - .pg_stats = &nfs4_callback_stats, .pg_authenticate = nfs_callback_authenticate, .pg_init_request = svc_generic_init_request, .pg_rpcbind_set = svc_generic_rpcbind_set,
fs/nfsd/nfssvc.c +0 -5
@@ -80,7 +80,6 @@ unsigned long nfsd_drc_max_mem;unsigned long nfsd_drc_mem_used;#if defined(CONFIG_NFSD_V2_ACL ) || defined(CONFIG_NFSD_V3_ACL ) -static struct svc_stat nfsd_acl_svcstats;static const struct svc_version *nfsd_acl_version[] = { # if defined(CONFIG_NFSD_V2_ACL) [2] = &nfsd_acl_version2,
@@ -99,15 +98,11 @@ static struct svc_program nfsd_acl_program = { .pg_vers = nfsd_acl_version, .pg_name = "nfsacl", .pg_class = "nfsd", - .pg_stats = &nfsd_acl_svcstats, .pg_authenticate = &svc_set_client, .pg_init_request = nfsd_acl_init_request, .pg_rpcbind_set = nfsd_acl_rpcbind_set, }; -static struct svc_stat nfsd_acl_svcstats = { - .program = &nfsd_acl_program, -};#endif /* defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) */ static const struct svc_version *nfsd_version[] = {
Signature · 1 line
2.43.0
PATCH v3 3/10 sunrpc: pass in the sv_stats struct through svc_create_pooled
In reply to Josef BacikSince only one service actually reports the rpc stats there's not much of a reason to have a pointer to it in the svc_program struct. Adjust the svc_create_pooled function to take the sv_stats as an argument and pass the struct through there as desired instead of getting it from the svc_program->pg_stats.
--- fs/nfsd/nfssvc.c | 3 ++- include/linux/sunrpc/svc.h | 4 ++-- net/sunrpc/svc.c | 12 +++++++----- 3 files changed, 11 insertions(+), 8 deletions(-)
fs/nfsd/nfssvc.c +2 -1
@@ -661,7 +661,8 @@ int nfsd_create_serv(struct net *net)if (nfsd_max_blksize ==0 ) nfsd_max_blksize =nfsd_get_default_max_blksize ();nfsd_reset_versions (nn); - serv =svc_create_pooled (&nfsd_program, nfsd_max_blksize, nfsd); + serv =svc_create_pooled (&nfsd_program, &nfsd_svcstats, + nfsd_max_blksize, nfsd);if (serv ==NULL )return -ENOMEM ;
include/linux/sunrpc/svc.h +2 -2
@@ -411,8 +411,8 @@ bool svc_rqst_replace_page(struct svc_rqst *rqstp,void svc_rqst_release_pages (struct svc_rqst *rqstp);void svc_rqst_free (struct svc_rqst *);void svc_exit_thread (struct svc_rqst *); -struct svc_serv *svc_create_pooled (struct svc_program *,unsigned int , -int (*threadfn)(void *data)); +struct svc_serv *svc_create_pooled (struct svc_program *,struct svc_stat *, +unsigned int ,int (*threadfn)(void *data));int svc_set_num_threads (struct svc_serv *,struct svc_pool *,int );int svc_pool_stats_open (struct svc_info *si,struct file *file);void svc_process (struct svc_rqst *rqstp);
net/sunrpc/svc.c +7 -5
@@ -451,8 +451,8 @@ __svc_init_bc(struct svc_serv *serv)* Create an RPC service */ static struct svc_serv * -__svc_create (struct svc_program *prog,unsigned int bufsize,int npools, -int (*threadfn)(void *data)) +__svc_create (struct svc_program *prog,struct svc_stat *stats, +unsigned int bufsize,int npools,int (*threadfn)(void *data)) {struct svc_serv *serv;unsigned int vers;
@@ -463,7 +463,7 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,return NULL ; serv->sv_name = prog->pg_name; serv->sv_program = prog; - serv->sv_stats = prog->pg_stats; + serv->sv_stats = stats;if (bufsize >RPCSVC_MAXPAYLOAD ) bufsize =RPCSVC_MAXPAYLOAD ; serv->sv_max_payload = bufsize? bufsize :4096 ;
@@ -529,26 +529,28 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,struct svc_serv *svc_create (struct svc_program *prog,unsigned int bufsize,int (*threadfn)(void *data)) { -return __svc_create (prog, bufsize,1 , threadfn); +return __svc_create (prog,NULL , bufsize,1 , threadfn); }EXPORT_SYMBOL_GPL (svc_create);/** * svc_create_pooled - Create an RPC service with pooled threads * @prog: the RPC program the new service will handle +* @stats: the stats struct if desired * @bufsize: maximum message size for @prog * @threadfn: a function to service RPC requests for @prog * * Returns an instantiated struct svc_serv object or NULL. */ struct svc_serv *svc_create_pooled (struct svc_program *prog, +struct svc_stat *stats,unsigned int bufsize,int (*threadfn)(void *data)) {struct svc_serv *serv;unsigned int npools =svc_pool_map_get (); - serv =__svc_create (prog, bufsize, npools, threadfn); + serv =__svc_create (prog, stats, bufsize, npools, threadfn);if (!serv) goto out_err;return serv;
Signature · 1 line
2.43.0
PATCH v3 4/10 sunrpc: remove ->pg_stats from svc_program
In reply to Josef BacikNow that this isn't used anywhere, remove it.
--- fs/nfsd/nfssvc.c | 1 - include/linux/sunrpc/svc.h | 1 - 2 files changed, 2 deletions(-)
fs/nfsd/nfssvc.c +0 -1
@@ -127,7 +127,6 @@ struct svc_program nfsd_program = { .pg_vers = nfsd_version, /* version table */ .pg_name = "nfsd", /* program name */ .pg_class = "nfsd", /* authentication class */ - .pg_stats = &nfsd_svcstats, /* version table */ .pg_authenticate = &svc_set_client, /* export authentication */ .pg_init_request = nfsd_init_request, .pg_rpcbind_set = nfsd_rpcbind_set,
include/linux/sunrpc/svc.h +0 -1
@@ -339,7 +339,6 @@ struct svc_program {const struct svc_version **pg_vers;/* version array */ char * pg_name;/* service name */ char * pg_class;/* class name: services sharing authentication */ -struct svc_stat * pg_stats;/* rpc statistics */ enum svc_auth_status (*pg_authenticate)(struct svc_rqst *rqstp); __be32 (*pg_init_request)(struct svc_rqst *, const struct svc_program *,
Signature · 1 line
2.43.0
PATCH v3 5/10 sunrpc: use the struct net as the svc proc private
In reply to Josef Baciknfsd is the only thing using this helper, and it doesn't use the private currently. When we switch to per-network namespace stats we will need the struct net * in order to get to the nfsd_net. Use the net as the proc private so we can utilize this when we make the switch over.
--- net/sunrpc/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/stats.c +1 -1
@@ -314,7 +314,7 @@ EXPORT_SYMBOL_GPL(rpc_proc_unregister);struct proc_dir_entry *svc_proc_register (struct net *net,struct svc_stat *statp,const struct proc_ops *proc_ops) { -return do_register (net, statp->program->pg_name, statp, proc_ops); +return do_register (net, statp->program->pg_name, net, proc_ops); }EXPORT_SYMBOL_GPL (svc_proc_register);
Signature · 1 line
2.43.0
PATCH v3 6/10 nfsd: rename NFSD_NET_* to NFSD_STATS_*
In reply to Josef BacikWe're going to merge the stats all into per network namespace in subsequent patches, rename these nn counters to be consistent with the rest of the stats.
--- fs/nfsd/netns.h | 4 ++-- fs/nfsd/nfscache.c | 4 ++-- fs/nfsd/stats.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-)
fs/nfsd/netns.h +2 -2
@@ -26,9 +26,9 @@ struct nfsd4_client_tracking_ops;enum {/* cache misses due only to checksum comparison failures */ -NFSD_NET_PAYLOAD_MISSES , +NFSD_STATS_PAYLOAD_MISSES ,/* amount of memory (in bytes) currently consumed by the DRC */ -NFSD_NET_DRC_MEM_USAGE , +NFSD_STATS_DRC_MEM_USAGE ,NFSD_NET_COUNTERS_NUM };
fs/nfsd/nfscache.c +2 -2
@@ -687,7 +687,7 @@ int nfsd_reply_cache_stats_show(struct seq_file *m, void *v) atomic_read(&nn->num_drc_entries));seq_printf (m,"hash buckets: %u\n" ,1 << nn->maskbits);seq_printf (m,"mem usage: %lld\n" , -percpu_counter_sum_positive (&nn->counter[NFSD_NET_DRC_MEM_USAGE ])); +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_DRC_MEM_USAGE ]));seq_printf (m,"cache hits: %lld\n" ,percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_RC_HITS ])); seq_printf(m, "cache misses: %lld\n",
@@ -695,7 +695,7 @@ int nfsd_reply_cache_stats_show(struct seq_file *m, void *v)seq_printf (m,"not cached: %lld\n" ,percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_RC_NOCACHE ]));seq_printf (m,"payload misses: %lld\n" , -percpu_counter_sum_positive (&nn->counter[NFSD_NET_PAYLOAD_MISSES ])); +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_PAYLOAD_MISSES ]));seq_printf (m,"longest chain len: %u\n" , nn->longest_chain);seq_printf (m,"cachesize at longest: %u\n" , nn->longest_chain_cachesize);return 0 ;
fs/nfsd/stats.h +3 -3
@@ -81,17 +81,17 @@ static inline void nfsd_stats_io_write_add(struct svc_export *exp, s64 amount)static inline void nfsd_stats_payload_misses_inc (struct nfsd_net *nn) { -percpu_counter_inc (&nn->counter[NFSD_NET_PAYLOAD_MISSES ]); +percpu_counter_inc (&nn->counter[NFSD_STATS_PAYLOAD_MISSES ]); }static inline void nfsd_stats_drc_mem_usage_add (struct nfsd_net *nn,s64 amount) { -percpu_counter_add (&nn->counter[NFSD_NET_DRC_MEM_USAGE ], amount); +percpu_counter_add (&nn->counter[NFSD_STATS_DRC_MEM_USAGE ], amount); }static inline void nfsd_stats_drc_mem_usage_sub (struct nfsd_net *nn,s64 amount) { -percpu_counter_sub (&nn->counter[NFSD_NET_DRC_MEM_USAGE ], amount); +percpu_counter_sub (&nn->counter[NFSD_STATS_DRC_MEM_USAGE ], amount); }#ifdef CONFIG_NFSD_V4
Signature · 1 line
2.43.0
PATCH v3 7/10 nfsd: expose /proc/net/sunrpc/nfsd in net namespaces
In reply to Josef BacikWe are running nfsd servers inside of containers with their own network namespace, and we want to monitor these services using the stats found in /proc. However these are not exposed in the proc inside of the container, so we have to bind mount the host /proc into our containers to get at this information.
Separate out the stat counters init and the proc registration, and move the proc registration into the pernet operations entry and exit points so that these stats can be exposed inside of network namespaces.
This is an intermediate step, this just exposes the global counters in the network namespace. Subsequent patches will move these counters into the per-network namespace container.
--- fs/nfsd/nfsctl.c | 8 +++++--- fs/nfsd/stats.c | 21 ++++++--------------- fs/nfsd/stats.h | 6 ++++-- 3 files changed, 15 insertions(+), 20 deletions(-)
fs/nfsd/nfsctl.c +5 -3
@@ -1679,6 +1679,7 @@ static __net_init int nfsd_net_init(struct net *net)nfsd4_init_leases_net (nn);get_random_bytes (&nn->siphash_key,sizeof (nn->siphash_key));seqlock_init (&nn->writeverf_lock); +nfsd_proc_stat_init (net);return 0 ;
@@ -1699,6 +1700,7 @@ static __net_exit void nfsd_net_exit(struct net *net) {struct nfsd_net *nn =net_generic (net, nfsd_net_id); +nfsd_proc_stat_shutdown (net);nfsd_net_reply_cache_destroy (nn);nfsd_idmap_shutdown (net);nfsd_export_shutdown (net);
@@ -1722,7 +1724,7 @@ static int __init init_nfsd(void) retval =nfsd4_init_pnfs ();if (retval) goto out_free_slabs; - retval =nfsd_stat_init ();/* Statistics */ + retval =nfsd_stat_counters_init ();/* Statistics */ if (retval) goto out_free_pnfs; retval =nfsd_drc_slab_create ();
@@ -1762,7 +1764,7 @@ static int __init init_nfsd(void)nfsd_lockd_shutdown ();nfsd_drc_slab_free (); out_free_stat: -nfsd_stat_shutdown (); +nfsd_stat_counters_destroy (); out_free_pnfs:nfsd4_exit_pnfs (); out_free_slabs:
@@ -1780,7 +1782,7 @@ static void __exit exit_nfsd(void)nfsd_drc_slab_free ();remove_proc_entry ("fs/nfs/exports" ,NULL );remove_proc_entry ("fs/nfs" ,NULL ); -nfsd_stat_shutdown (); +nfsd_stat_counters_destroy ();nfsd_lockd_shutdown ();nfsd4_free_slabs ();nfsd4_exit_pnfs ();
fs/nfsd/stats.c +6 -15
@@ -108,31 +108,22 @@ void nfsd_percpu_counters_destroy(struct percpu_counter counters[], int num)percpu_counter_destroy (&counters[i]); } -static int nfsd_stat_counters_init (void ) +int nfsd_stat_counters_init (void ) {return nfsd_percpu_counters_init (nfsdstats.counter,NFSD_STATS_COUNTERS_NUM ); } -static void nfsd_stat_counters_destroy (void ) +void nfsd_stat_counters_destroy (void ) {nfsd_percpu_counters_destroy (nfsdstats.counter,NFSD_STATS_COUNTERS_NUM ); } -int nfsd_stat_init (void ) +void nfsd_proc_stat_init (struct net *net) { -int err; - - err =nfsd_stat_counters_init (); -if (err) -return err; - -svc_proc_register (&init_net, &nfsd_svcstats, &nfsd_proc_ops); - -return 0 ; +svc_proc_register (net, &nfsd_svcstats, &nfsd_proc_ops); } -void nfsd_stat_shutdown (void ) +void nfsd_proc_stat_shutdown (struct net *net) { -nfsd_stat_counters_destroy (); -svc_proc_unregister (&init_net,"nfsd" ); +svc_proc_unregister (net,"nfsd" ); }
fs/nfsd/stats.h +4 -2
@@ -40,8 +40,10 @@ extern struct svc_stat nfsd_svcstats;int nfsd_percpu_counters_init (struct percpu_counter *counters,int num);void nfsd_percpu_counters_reset (struct percpu_counter *counters,int num);void nfsd_percpu_counters_destroy (struct percpu_counter *counters,int num); -int nfsd_stat_init (void ); -void nfsd_stat_shutdown (void ); +int nfsd_stat_counters_init (void ); +void nfsd_stat_counters_destroy (void ); +void nfsd_proc_stat_init (struct net *net); +void nfsd_proc_stat_shutdown (struct net *net);static inline void nfsd_stats_rc_hits_inc (void ) {
Signature · 1 line
2.43.0
PATCH v3 8/10 nfsd: make all of the nfsd stats per-network namespace
In reply to Josef BacikWe have a global set of counters that we modify for all of the nfsd operations, but now that we're exposing these stats across all network namespaces we need to make the stats also be per-network namespace. We already have some caching stats that are per-network namespace, so move these definitions into the same counter and then adjust all the helpers and users of these stats to provide the appropriate nfsd_net struct so that the stats are maintained for the per-network namespace objects.
--- fs/nfsd/cache.h | 2 -- fs/nfsd/netns.h | 17 ++++++++++++-- fs/nfsd/nfs4proc.c | 6 ++--- fs/nfsd/nfs4state.c | 3 ++- fs/nfsd/nfscache.c | 36 ++++++------------------------ fs/nfsd/nfsctl.c | 12 +++------- fs/nfsd/nfsfh.c | 3 ++- fs/nfsd/stats.c | 26 ++++++++++++---------- fs/nfsd/stats.h | 54 ++++++++++++++++----------------------------- fs/nfsd/vfs.c | 5 +++-- 10 files changed, 68 insertions(+), 96 deletions(-)
fs/nfsd/cache.h +0 -2
@@ -80,8 +80,6 @@ enum {int nfsd_drc_slab_create (void );void nfsd_drc_slab_free (void ); -int nfsd_net_reply_cache_init (struct nfsd_net *nn); -void nfsd_net_reply_cache_destroy (struct nfsd_net *nn);int nfsd_reply_cache_init (struct nfsd_net *);void nfsd_reply_cache_shutdown (struct nfsd_net *); int nfsd_cache_lookup(struct svc_rqst *rqstp, unsigned int start,
fs/nfsd/netns.h +15 -2
@@ -11,6 +11,7 @@#include <net/net_namespace.h> #include <net/netns/generic.h> #include <linux/filelock.h> +#include <linux/nfs4.h> #include <linux/percpu_counter.h> #include <linux/siphash.h>
@@ -29,7 +30,19 @@ enum {NFSD_STATS_PAYLOAD_MISSES ,/* amount of memory (in bytes) currently consumed by the DRC */ NFSD_STATS_DRC_MEM_USAGE , - NFSD_NET_COUNTERS_NUM +NFSD_STATS_RC_HITS ,/* repcache hits */ +NFSD_STATS_RC_MISSES ,/* repcache misses */ +NFSD_STATS_RC_NOCACHE ,/* uncached reqs */ +NFSD_STATS_FH_STALE ,/* FH stale error */ +NFSD_STATS_IO_READ ,/* bytes returned to read requests */ +NFSD_STATS_IO_WRITE ,/* bytes passed in write requests */ +#ifdef CONFIG_NFSD_V4 +NFSD_STATS_FIRST_NFS4_OP ,/* count of individual nfsv4 operations */ +NFSD_STATS_LAST_NFS4_OP =NFSD_STATS_FIRST_NFS4_OP +LAST_NFS4_OP , +#define NFSD_STATS_NFS4_OP(op) (NFSD_STATS_FIRST_NFS4_OP + (op)) +NFSD_STATS_WDELEG_GETATTR ,/* count of getattr conflict with wdeleg */ +#endif +NFSD_STATS_COUNTERS_NUM };/*
@@ -164,7 +177,7 @@ struct nfsd_net {atomic_t num_drc_entries;/* Per-netns stats counters */ -struct percpu_counter counter[NFSD_NET_COUNTERS_NUM ]; +struct percpu_counter counter[NFSD_STATS_COUNTERS_NUM ];/* longest hash chain seen */ unsigned int longest_chain;
fs/nfsd/nfs4proc.c +3 -3
@@ -2490,10 +2490,10 @@ nfsd4_proc_null(struct svc_rqst *rqstp)return rpc_success; } -static inline void nfsd4_increment_op_stats (u32 opnum) +static inline void nfsd4_increment_op_stats (struct nfsd_net *nn,u32 opnum) {if (opnum >=FIRST_NFS4_OP && opnum <=LAST_NFS4_OP ) -percpu_counter_inc (&nfsdstats.counter[NFSD_STATS_NFS4_OP (opnum)]); +percpu_counter_inc (&nn->counter[NFSD_STATS_NFS4_OP (opnum)]); }static const struct nfsd4_operation nfsd4_ops[];
@@ -2768,7 +2768,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) status, nfsd4_op_name(op->opnum));nfsd4_cstate_clear_replay (cstate); -nfsd4_increment_op_stats (op->opnum); +nfsd4_increment_op_stats (nn, op->opnum); }fh_put (current_fh);
fs/nfsd/nfs4state.c +2 -1
@@ -8457,6 +8457,7 @@ __be32 nfsd4_deleg_getattr_conflict(struct svc_rqst *rqstp, struct inode *inode) { __be32 status; +struct nfsd_net *nn =net_generic (SVC_NET (rqstp), nfsd_net_id);struct file_lock_context *ctx;struct file_lock *fl;struct nfs4_delegation *dp;
@@ -8486,7 +8487,7 @@ nfsd4_deleg_getattr_conflict(struct svc_rqst *rqstp, struct inode *inode) } break_lease:spin_unlock (&ctx->flc_lock); -nfsd_stats_wdeleg_getattr_inc (); +nfsd_stats_wdeleg_getattr_inc (nn); status =nfserrno (nfsd_open_break_lease (inode,NFSD_MAY_READ ));if (status != nfserr_jukebox || !nfsd_wait_for_delegreturn (rqstp, inode))
fs/nfsd/nfscache.c +7 -29
@@ -176,27 +176,6 @@ void nfsd_drc_slab_free(void)kmem_cache_destroy (drc_slab); } -/** -* nfsd_net_reply_cache_init - per net namespace reply cache set-up -* @nn: nfsd_net being initialized -* -* Returns zero on succes; otherwise a negative errno is returned. -*/ -int nfsd_net_reply_cache_init (struct nfsd_net *nn) -{ -return nfsd_percpu_counters_init (nn->counter,NFSD_NET_COUNTERS_NUM ); -} - -/** -* nfsd_net_reply_cache_destroy - per net namespace reply cache tear-down -* @nn: nfsd_net being freed -* -*/ -void nfsd_net_reply_cache_destroy (struct nfsd_net *nn) -{ -nfsd_percpu_counters_destroy (nn->counter,NFSD_NET_COUNTERS_NUM ); -} -int nfsd_reply_cache_init (struct nfsd_net *nn) {unsigned int hashsize;
@@ -501,7 +480,7 @@ nfsd_cache_insert(struct nfsd_drc_bucket *b, struct nfsd_cacherep *key,int nfsd_cache_lookup (struct svc_rqst *rqstp,unsigned int start,unsigned int len,struct nfsd_cacherep **cacherep) { -struct nfsd_net *nn; +struct nfsd_net *nn =net_generic (SVC_NET (rqstp), nfsd_net_id);struct nfsd_cacherep *rp, *found;__wsum csum;struct nfsd_drc_bucket *b;
@@ -510,7 +489,7 @@ int nfsd_cache_lookup(struct svc_rqst *rqstp, unsigned int start,int rtn =RC_DOIT ;if (type ==RC_NOCACHE ) { -nfsd_stats_rc_nocache_inc (); +nfsd_stats_rc_nocache_inc (nn); goto out; }
@@ -520,7 +499,6 @@ int nfsd_cache_lookup(struct svc_rqst *rqstp, unsigned int start,* Since the common case is a cache miss followed by an insert, * preallocate an entry. */ - nn =net_generic (SVC_NET (rqstp), nfsd_net_id); rp =nfsd_cacherep_alloc (rqstp, csum, nn);if (!rp) goto out;
@@ -537,7 +515,7 @@ int nfsd_cache_lookup(struct svc_rqst *rqstp, unsigned int start,nfsd_cacherep_dispose (&dispose); -nfsd_stats_rc_misses_inc (); +nfsd_stats_rc_misses_inc (nn);atomic_inc (&nn->num_drc_entries);nfsd_stats_drc_mem_usage_add (nn,sizeof (*rp)); goto out;
@@ -545,7 +523,7 @@ int nfsd_cache_lookup(struct svc_rqst *rqstp, unsigned int start, found_entry:/* We found a matching entry which is either in progress or done. */ nfsd_reply_cache_free_locked (NULL , rp, nn); -nfsd_stats_rc_hits_inc (); +nfsd_stats_rc_hits_inc (nn); rtn =RC_DROPIT ; rp = found;
@@ -689,11 +667,11 @@ int nfsd_reply_cache_stats_show(struct seq_file *m, void *v)seq_printf (m,"mem usage: %lld\n" ,percpu_counter_sum_positive (&nn->counter[NFSD_STATS_DRC_MEM_USAGE ]));seq_printf (m,"cache hits: %lld\n" , -percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_RC_HITS ])); +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_RC_HITS ]));seq_printf (m,"cache misses: %lld\n" , -percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_RC_MISSES ])); +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_RC_MISSES ]));seq_printf (m,"not cached: %lld\n" , -percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_RC_NOCACHE ])); +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_RC_NOCACHE ]));seq_printf (m,"payload misses: %lld\n" ,percpu_counter_sum_positive (&nn->counter[NFSD_STATS_PAYLOAD_MISSES ]));seq_printf (m,"longest chain len: %u\n" , nn->longest_chain);
fs/nfsd/nfsctl.c +3 -9
@@ -1671,7 +1671,7 @@ static __net_init int nfsd_net_init(struct net *net) retval =nfsd_idmap_init (net);if (retval) goto out_idmap_error; - retval =nfsd_net_reply_cache_init (nn); + retval =nfsd_stat_counters_init (nn);if (retval) goto out_repcache_error; nn->nfsd_versions =NULL ;
@@ -1701,7 +1701,7 @@ static __net_exit void nfsd_net_exit(struct net *net)struct nfsd_net *nn =net_generic (net, nfsd_net_id);nfsd_proc_stat_shutdown (net); -nfsd_net_reply_cache_destroy (nn); +nfsd_stat_counters_destroy (nn);nfsd_idmap_shutdown (net);nfsd_export_shutdown (net);nfsd_netns_free_versions (nn);
@@ -1724,12 +1724,9 @@ static int __init init_nfsd(void) retval =nfsd4_init_pnfs ();if (retval) goto out_free_slabs; - retval =nfsd_stat_counters_init ();/* Statistics */ -if (retval) - goto out_free_pnfs; retval =nfsd_drc_slab_create ();if (retval) - goto out_free_stat; + goto out_free_pnfs;nfsd_lockd_init ();/* lockd->nfsd callbacks */ retval =create_proc_exports_entry ();if (retval)
@@ -1763,8 +1760,6 @@ static int __init init_nfsd(void) out_free_lockd:nfsd_lockd_shutdown ();nfsd_drc_slab_free (); -out_free_stat: -nfsd_stat_counters_destroy (); out_free_pnfs:nfsd4_exit_pnfs (); out_free_slabs:
@@ -1782,7 +1777,6 @@ static void __exit exit_nfsd(void)nfsd_drc_slab_free ();remove_proc_entry ("fs/nfs/exports" ,NULL );remove_proc_entry ("fs/nfs" ,NULL ); -nfsd_stat_counters_destroy ();nfsd_lockd_shutdown ();nfsd4_free_slabs ();nfsd4_exit_pnfs ();
fs/nfsd/nfsfh.c +2 -1
@@ -327,6 +327,7 @@ static __be32 nfsd_set_fh_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp)__be32 fh_verify (struct svc_rqst *rqstp,struct svc_fh *fhp,umode_t type,int access) { +struct nfsd_net *nn =net_generic (SVC_NET (rqstp), nfsd_net_id);struct svc_export *exp =NULL ;struct dentry *dentry;__be32 error;
@@ -395,7 +396,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, int access) out:trace_nfsd_fh_verify_err (rqstp, fhp, type, access, error);if (error == nfserr_stale) -nfsd_stats_fh_stale_inc (exp); +nfsd_stats_fh_stale_inc (nn, exp);return error; }
fs/nfsd/stats.c +14 -12
@@ -34,15 +34,17 @@ struct svc_stat nfsd_svcstats = {static int nfsd_show (struct seq_file *seq,void *v) { +struct net *net =pde_data (file_inode (seq->file)); +struct nfsd_net *nn =net_generic (net, nfsd_net_id);int i;seq_printf (seq,"rc %lld %lld %lld\nfh %lld 0 0 0 0\nio %lld %lld\n" , -percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_RC_HITS ]), -percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_RC_MISSES ]), -percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_RC_NOCACHE ]), -percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_FH_STALE ]), -percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_IO_READ ]), -percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_IO_WRITE ])); +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_RC_HITS ]), +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_RC_MISSES ]), +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_RC_NOCACHE ]), +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_FH_STALE ]), +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_IO_READ ]), +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_IO_WRITE ]));/* thread usage: */ seq_printf (seq,"th %u 0" ,atomic_read (&nfsdstats.th_cnt));
@@ -63,10 +65,10 @@ static int nfsd_show(struct seq_file *seq, void *v)seq_printf (seq,"proc4ops %u" ,LAST_NFS4_OP +1 );for (i =0 ; i <=LAST_NFS4_OP ; i++) {seq_printf (seq," %lld" , -percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_NFS4_OP (i)])); +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_NFS4_OP (i)])); }seq_printf (seq,"\nwdeleg_getattr %lld" , -percpu_counter_sum_positive (&nfsdstats.counter[NFSD_STATS_WDELEG_GETATTR ])); +percpu_counter_sum_positive (&nn->counter[NFSD_STATS_WDELEG_GETATTR ]));seq_putc (seq,'\n' );#endif
@@ -108,14 +110,14 @@ void nfsd_percpu_counters_destroy(struct percpu_counter counters[], int num)percpu_counter_destroy (&counters[i]); } -int nfsd_stat_counters_init (void ) +int nfsd_stat_counters_init (struct nfsd_net *nn) { -return nfsd_percpu_counters_init (nfsdstats.counter,NFSD_STATS_COUNTERS_NUM ); +return nfsd_percpu_counters_init (nn->counter,NFSD_STATS_COUNTERS_NUM ); } -void nfsd_stat_counters_destroy (void ) +void nfsd_stat_counters_destroy (struct nfsd_net *nn) { -nfsd_percpu_counters_destroy (nfsdstats.counter,NFSD_STATS_COUNTERS_NUM ); +nfsd_percpu_counters_destroy (nn->counter,NFSD_STATS_COUNTERS_NUM ); }void nfsd_proc_stat_init (struct net *net)
fs/nfsd/stats.h +19 -35
97 lines not on this page · raw message
fs/nfsd/vfs.c +3 -2
@@ -1002,7 +1002,8 @@ static __be32 nfsd_finish_read(struct svc_rqst *rqstp, struct svc_fh *fhp, unsigned long *count, u32 *eof, ssize_t host_err) { if (host_err >= 0) { - nfsd_stats_io_read_add(fhp->fh_export, host_err); + struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); +nfsd_stats_io_read_add (nn, fhp->fh_export, host_err); *eof =nfsd_eof_on_read (file, offset, host_err, *count); *count = host_err;fsnotify_access (file);
@@ -1185,7 +1186,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf, goto out_nfserr; } *cnt = host_err; -nfsd_stats_io_write_add (exp, *cnt); +nfsd_stats_io_write_add (nn, exp, *cnt);fsnotify_modify (file); host_err =filemap_check_wb_err (file->f_mapping, since);if (host_err <0 )
Signature · 1 line
2.43.0
PATCH v3 9/10 nfsd: remove nfsd_stats, make th_cnt a global counter
In reply to Josef BacikThis is the last global stat, take it out of the nfsd_stats struct and make it a global part of nfsd, report it the same as always.
--- fs/nfsd/nfsd.h | 1 + fs/nfsd/nfssvc.c | 5 +++-- fs/nfsd/stats.c | 3 +-- fs/nfsd/stats.h | 6 ------ 4 files changed, 5 insertions(+), 10 deletions(-)
fs/nfsd/nfsd.h +1 -0
@@ -86,6 +86,7 @@ extern struct mutex nfsd_mutex;extern spinlock_t nfsd_drc_lock;extern unsigned long nfsd_drc_max_mem;extern unsigned long nfsd_drc_mem_used; +extern atomic_t nfsd_th_cnt;/* number of available threads */ extern const struct seq_operations nfs_exports_op;
fs/nfsd/nfssvc.c +3 -2
@@ -34,6 +34,7 @@#define NFSDDBG_FACILITY NFSDDBG_SVC +atomic_t nfsd_th_cnt =ATOMIC_INIT (0 );extern struct svc_program nfsd_program;static int nfsd (void *vrqstp);#if defined(CONFIG_NFSD_V2_ACL ) || defined(CONFIG_NFSD_V3_ACL )
@@ -924,7 +925,7 @@ nfsd(void *vrqstp) current->fs->umask =0 ; -atomic_inc (&nfsdstats.th_cnt); +atomic_inc (&nfsd_th_cnt);set_freezable ();
@@ -940,7 +941,7 @@ nfsd(void *vrqstp)nfsd_file_net_dispose (nn); } -atomic_dec (&nfsdstats.th_cnt); +atomic_dec (&nfsd_th_cnt); out:/* Release the thread */
fs/nfsd/stats.c +1 -2
@@ -27,7 +27,6 @@#include "nfsd.h" -struct nfsd_stats nfsdstats;struct svc_stat nfsd_svcstats = { .program = &nfsd_program, };
@@ -47,7 +46,7 @@ static int nfsd_show(struct seq_file *seq, void *v) percpu_counter_sum_positive(&nn->counter[NFSD_STATS_IO_WRITE]));/* thread usage: */ -seq_printf (seq,"th %u 0" ,atomic_read (&nfsdstats.th_cnt)); +seq_printf (seq,"th %u 0" ,atomic_read (&nfsd_th_cnt));/* deprecated thread usage histogram stats */ for (i =0 ; i <10 ; i++)
fs/nfsd/stats.h +0 -6
@@ -10,12 +10,6 @@#include <uapi/linux/nfsd/stats.h> #include <linux/percpu_counter.h> -struct nfsd_stats { -atomic_t th_cnt;/* number of available threads */ -}; - -extern struct nfsd_stats nfsdstats; -extern struct svc_stat nfsd_svcstats;int nfsd_percpu_counters_init (struct percpu_counter *counters,int num);
Signature · 1 line
2.43.0
PATCH v3 10/10 nfsd: make svc_stat per-network namespace instead of global
In reply to Josef BacikThe final bit of stats that is global is the rpc svc_stat. Move this into the nfsd_net struct and use that everywhere instead of the global struct. Remove the unused global struct.
--- fs/nfsd/netns.h | 4 ++++ fs/nfsd/nfsctl.c | 2 ++ fs/nfsd/nfssvc.c | 2 +- fs/nfsd/stats.c | 10 ++++------ fs/nfsd/stats.h | 2 -- 5 files changed, 11 insertions(+), 9 deletions(-)
fs/nfsd/netns.h +4 -0
@@ -14,6 +14,7 @@#include <linux/nfs4.h> #include <linux/percpu_counter.h> #include <linux/siphash.h> +#include <linux/sunrpc/stats.h> /* Hash tables for nfs4_clientid state */ #define CLIENT_HASH_BITS 4
@@ -179,6 +180,9 @@ struct nfsd_net {/* Per-netns stats counters */ struct percpu_counter counter[NFSD_STATS_COUNTERS_NUM ]; +/* sunrpc svc stats */ +struct svc_stat nfsd_svcstats; +/* longest hash chain seen */ unsigned int longest_chain;
fs/nfsd/nfsctl.c +2 -0
@@ -1674,6 +1674,8 @@ static __net_init int nfsd_net_init(struct net *net) retval =nfsd_stat_counters_init (nn);if (retval) goto out_repcache_error; +memset (&nn->nfsd_svcstats,0 ,sizeof (nn->nfsd_svcstats)); + nn->nfsd_svcstats.program = &nfsd_program; nn->nfsd_versions =NULL ; nn->nfsd4_minorversions =NULL ;nfsd4_init_leases_net (nn);
fs/nfsd/nfssvc.c +1 -1
@@ -661,7 +661,7 @@ int nfsd_create_serv(struct net *net)if (nfsd_max_blksize ==0 ) nfsd_max_blksize =nfsd_get_default_max_blksize ();nfsd_reset_versions (nn); - serv =svc_create_pooled (&nfsd_program, &nfsd_svcstats, + serv =svc_create_pooled (&nfsd_program, &nn->nfsd_svcstats, nfsd_max_blksize, nfsd);if (serv ==NULL )return -ENOMEM ;
fs/nfsd/stats.c +4 -6
@@ -27,10 +27,6 @@#include "nfsd.h" -struct svc_stat nfsd_svcstats = { - .program = &nfsd_program, -}; -static int nfsd_show (struct seq_file *seq,void *v) {struct net *net =pde_data (file_inode (seq->file));
@@ -56,7 +52,7 @@ static int nfsd_show(struct seq_file *seq, void *v)seq_puts (seq,"\nra 0 0 0 0 0 0 0 0 0 0 0 0\n" );/* show my rpc info */ -svc_seq_show (seq, &nfsd_svcstats); +svc_seq_show (seq, &nn->nfsd_svcstats);#ifdef CONFIG_NFSD_V4 /* Show count for individual nfsv4 operations */
@@ -121,7 +117,9 @@ void nfsd_stat_counters_destroy(struct nfsd_net *nn)void nfsd_proc_stat_init (struct net *net) { -svc_proc_register (net, &nfsd_svcstats, &nfsd_proc_ops); +struct nfsd_net *nn =net_generic (net, nfsd_net_id); + +svc_proc_register (net, &nn->nfsd_svcstats, &nfsd_proc_ops); }void nfsd_proc_stat_shutdown (struct net *net)
fs/nfsd/stats.h +0 -2
@@ -10,8 +10,6 @@#include <uapi/linux/nfsd/stats.h> #include <linux/percpu_counter.h> -extern struct svc_stat nfsd_svcstats; -int nfsd_percpu_counters_init (struct percpu_counter *counters,int num);void nfsd_percpu_counters_reset (struct percpu_counter *counters,int num);void nfsd_percpu_counters_destroy (struct percpu_counter *counters,int num);
Signature · 1 line
2.43.0
Quoted 10 lines · Josef Bacik
v1: https://lore.kernel.org/linux-nfs/[email protected]/
v2: https://lore.kernel.org/linux-nfs/[email protected]/NOTE: there's still one nfs change in here and it's where I dropped
pg_stats, I assume that's ok for this series, but I can break it out and then follow up with a removal later if necessary.
If that's for the NFSv4 callback service, I think that's OK for me to take through the NFSD tree. An Ack from the client maintainers would be lovely, but is not required.
If Jeff agrees, I'd like to take v3 for v6.9, and then Jeff (or I) can follow up with a patch fixing the thread count stat. Jeff?
Quoted 34 lines
v2->v3:
- Split out the nfs and nfsd related changes into their own patches.
- Dropped the change addingsv_statsthrouchsvc_create()
- Changed theth_cntto be global, re-arranged it's location.
v1->v2:
- rework the sunprc service creation to take a pointer to thesv_stats.
- dropped ->pg_stats from thesvc_program.
- converted all of the nfsd global stats to per-network namespace.
- added the ability to point at a specificrpc_statfor rpc program creation.
- converted the rpc stats for nfs to per-network namespace.Josef Bacik (10):
sunrpc: don't change ->sv_stats if it doesn't exist
nfs: stop setting ->pg_stats for unused stats
sunrpc: pass in thesv_statsstruct throughsvc_create_pooled
sunrpc: remove ->pg_stats fromsvc_program
sunrpc: use the struct net as the svc proc private
nfsd: rename NFSD_NET_* to NFSD_STATS_*
nfsd: expose/proc/net/sunrpc/nfsdin net namespaces
nfsd: make all of the nfsd stats per-network namespace
nfsd: removenfsd_stats, maketh_cnta global counter
nfsd: makesvc_statper-network namespace instead of globalfs/lockd/svc.c | 3 -- fs/nfs/callback.c | 3 -- fs/nfsd/cache.h | 2 -- fs/nfsd/netns.h | 25 +++++++++++--- fs/nfsd/nfs4proc.c | 6 ++-- fs/nfsd/nfs4state.c | 3 +- fs/nfsd/nfscache.c | 40 +++++----------------- fs/nfsd/nfsctl.c | 16 ++++----- fs/nfsd/nfsd.h | 1 + fs/nfsd/nfsfh.c | 3 +-
Quoted 12 lines
fs/nfsd/nfssvc.c | 14 +++----- fs/nfsd/stats.c | 52 ++++++++++++---------------- fs/nfsd/stats.h | 70 +++++++++++++------------------------- fs/nfsd/vfs.c | 5 +-- include/linux/sunrpc/svc.h | 5 ++- net/sunrpc/stats.c | 2 +- net/sunrpc/svc.c | 39 +++++++++++++-------- 17 files changed, 126 insertions(+), 163 deletions(-)Signature · 1 line
2.43.0
--
Chuck Lever
Quoted 10 lines · Chuck Lever III
Quoted 9 lines · Josef Bacik
v1: https://lore.kernel.org/linux-nfs/[email protected]/
v2: https://lore.kernel.org/linux-nfs/[email protected]/NOTE: there's still one nfs change in here and it's where I dropped
pg_stats, I assume that's ok for this series, but I can break it out and then follow up with a removal later if necessary.
Quoted 9 lines
If that's for the NFSv4 callback service, I think that's OK for me to take through the NFSD tree. An Ack from the client maintainers would be lovely, but is not required.
If Jeff agrees, I'd like to take v3 for v6.9, and then Jeff (or I) can follow up with a patch fixing the thread count stat. Jeff?
Yep. This looks great for v6.9. You can add:
Quoted 51 lines
Quoted 34 lines
v2->v3:
- Split out the nfs and nfsd related changes into their own patches.
- Dropped the change addingsv_statsthrouchsvc_create()
- Changed theth_cntto be global, re-arranged it's location.
v1->v2:
- rework the sunprc service creation to take a pointer to thesv_stats.
- dropped ->pg_stats from thesvc_program.
- converted all of the nfsd global stats to per-network namespace.
- added the ability to point at a specificrpc_statfor rpc program creation.
- converted the rpc stats for nfs to per-network namespace.Josef Bacik (10):
sunrpc: don't change ->sv_stats if it doesn't exist
nfs: stop setting ->pg_stats for unused stats
sunrpc: pass in thesv_statsstruct throughsvc_create_pooled
sunrpc: remove ->pg_stats fromsvc_program
sunrpc: use the struct net as the svc proc private
nfsd: rename NFSD_NET_* to NFSD_STATS_*
nfsd: expose/proc/net/sunrpc/nfsdin net namespaces
nfsd: make all of the nfsd stats per-network namespace
nfsd: removenfsd_stats, maketh_cnta global counter
nfsd: makesvc_statper-network namespace instead of globalfs/lockd/svc.c | 3 -- fs/nfs/callback.c | 3 -- fs/nfsd/cache.h | 2 -- fs/nfsd/netns.h | 25 +++++++++++--- fs/nfsd/nfs4proc.c | 6 ++-- fs/nfsd/nfs4state.c | 3 +- fs/nfsd/nfscache.c | 40 +++++----------------- fs/nfsd/nfsctl.c | 16 ++++----- fs/nfsd/nfsd.h | 1 + fs/nfsd/nfsfh.c | 3 +-Quoted 12 lines
fs/nfsd/nfssvc.c | 14 +++----- fs/nfsd/stats.c | 52 ++++++++++++---------------- fs/nfsd/stats.h | 70 +++++++++++++------------------------- fs/nfsd/vfs.c | 5 +-- include/linux/sunrpc/svc.h | 5 ++- net/sunrpc/stats.c | 2 +- net/sunrpc/svc.c | 39 +++++++++++++-------- 17 files changed, 126 insertions(+), 163 deletions(-)Signature · 1 line
2.43.0--
Chuck Lever
Signature · 1 line
Jeff Layton <[email protected]>