aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc/svc.h
diff options
context:
space:
mode:
authorGreg Banks <gnb@sgi.com>2009-01-13 05:26:36 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-03-18 17:38:42 -0400
commit03cf6c9f49a8fea953d38648d016e3f46e814991 (patch)
treec7e639bd9fb775af1919d2442d0bf2306dfbfca7 /include/linux/sunrpc/svc.h
parent59a252ff8c0f2fa32c896f69d56ae33e641ce7ad (diff)
knfsd: add file to export stats about nfsd pools
Add /proc/fs/nfsd/pool_stats to export to userspace various statistics about the operation of rpc server thread pools. This patch is based on a forward-ported version of knfsd-add-pool-thread-stats which has been shipping in the SGI "Enhanced NFS" product since 2006 and which was previously posted: http://article.gmane.org/gmane.linux.nfs/10375 It has also been updated thus: * moved EXPORT_SYMBOL() to near the function it exports * made the new struct struct seq_operations const * used SEQ_START_TOKEN instead of ((void *)1) * merged fix from SGI PV 990526 "sunrpc: use dprintk instead of printk in svc_pool_stats_*()" by Harshula Jayasuriya. * merged fix from SGI PV 964001 "Crash reading pool_stats before nfsds are started". Signed-off-by: Greg Banks <gnb@sgi.com> Signed-off-by: Harshula Jayasuriya <harshula@sgi.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'include/linux/sunrpc/svc.h')
-rw-r--r--include/linux/sunrpc/svc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 39ec186a492d..9f9f699dd469 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -24,6 +24,15 @@
24 */ 24 */
25typedef int (*svc_thread_fn)(void *); 25typedef int (*svc_thread_fn)(void *);
26 26
27/* statistics for svc_pool structures */
28struct svc_pool_stats {
29 unsigned long packets;
30 unsigned long sockets_queued;
31 unsigned long threads_woken;
32 unsigned long overloads_avoided;
33 unsigned long threads_timedout;
34};
35
27/* 36/*
28 * 37 *
29 * RPC service thread pool. 38 * RPC service thread pool.
@@ -42,6 +51,7 @@ struct svc_pool {
42 unsigned int sp_nrthreads; /* # of threads in pool */ 51 unsigned int sp_nrthreads; /* # of threads in pool */
43 struct list_head sp_all_threads; /* all server threads */ 52 struct list_head sp_all_threads; /* all server threads */
44 int sp_nwaking; /* number of threads woken but not yet active */ 53 int sp_nwaking; /* number of threads woken but not yet active */
54 struct svc_pool_stats sp_stats; /* statistics on pool operation */
45} ____cacheline_aligned_in_smp; 55} ____cacheline_aligned_in_smp;
46 56
47/* 57/*
@@ -396,6 +406,7 @@ struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
396 sa_family_t, void (*shutdown)(struct svc_serv *), 406 sa_family_t, void (*shutdown)(struct svc_serv *),
397 svc_thread_fn, struct module *); 407 svc_thread_fn, struct module *);
398int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); 408int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
409int svc_pool_stats_open(struct svc_serv *serv, struct file *file);
399void svc_destroy(struct svc_serv *); 410void svc_destroy(struct svc_serv *);
400int svc_process(struct svc_rqst *); 411int svc_process(struct svc_rqst *);
401int svc_register(const struct svc_serv *, const unsigned short, 412int svc_register(const struct svc_serv *, const unsigned short,