diff options
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/clnt.h | 20 | ||||
-rw-r--r-- | include/linux/sunrpc/gss_krb5.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/metrics.h | 77 | ||||
-rw-r--r-- | include/linux/sunrpc/rpc_pipe_fs.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/sched.h | 9 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 13 |
6 files changed, 107 insertions, 16 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index f147e6b84332..8fe9f35eba31 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -45,7 +45,8 @@ struct rpc_clnt { | |||
45 | char * cl_server; /* server machine name */ | 45 | char * cl_server; /* server machine name */ |
46 | char * cl_protname; /* protocol name */ | 46 | char * cl_protname; /* protocol name */ |
47 | struct rpc_auth * cl_auth; /* authenticator */ | 47 | struct rpc_auth * cl_auth; /* authenticator */ |
48 | struct rpc_stat * cl_stats; /* statistics */ | 48 | struct rpc_stat * cl_stats; /* per-program statistics */ |
49 | struct rpc_iostats * cl_metrics; /* per-client statistics */ | ||
49 | 50 | ||
50 | unsigned int cl_softrtry : 1,/* soft timeouts */ | 51 | unsigned int cl_softrtry : 1,/* soft timeouts */ |
51 | cl_intr : 1,/* interruptible */ | 52 | cl_intr : 1,/* interruptible */ |
@@ -59,6 +60,7 @@ struct rpc_clnt { | |||
59 | int cl_nodelen; /* nodename length */ | 60 | int cl_nodelen; /* nodename length */ |
60 | char cl_nodename[UNX_MAXNODENAME]; | 61 | char cl_nodename[UNX_MAXNODENAME]; |
61 | char cl_pathname[30];/* Path in rpc_pipe_fs */ | 62 | char cl_pathname[30];/* Path in rpc_pipe_fs */ |
63 | struct vfsmount * cl_vfsmnt; | ||
62 | struct dentry * cl_dentry; /* inode */ | 64 | struct dentry * cl_dentry; /* inode */ |
63 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ | 65 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
64 | struct rpc_rtt cl_rtt_default; | 66 | struct rpc_rtt cl_rtt_default; |
@@ -100,6 +102,8 @@ struct rpc_procinfo { | |||
100 | unsigned int p_bufsiz; /* req. buffer size */ | 102 | unsigned int p_bufsiz; /* req. buffer size */ |
101 | unsigned int p_count; /* call count */ | 103 | unsigned int p_count; /* call count */ |
102 | unsigned int p_timer; /* Which RTT timer to use */ | 104 | unsigned int p_timer; /* Which RTT timer to use */ |
105 | u32 p_statidx; /* Which procedure to account */ | ||
106 | char * p_name; /* name of procedure */ | ||
103 | }; | 107 | }; |
104 | 108 | ||
105 | #define RPC_CONGESTED(clnt) (RPCXPRT_CONGESTED((clnt)->cl_xprt)) | 109 | #define RPC_CONGESTED(clnt) (RPCXPRT_CONGESTED((clnt)->cl_xprt)) |
@@ -137,20 +141,6 @@ size_t rpc_max_payload(struct rpc_clnt *); | |||
137 | void rpc_force_rebind(struct rpc_clnt *); | 141 | void rpc_force_rebind(struct rpc_clnt *); |
138 | int rpc_ping(struct rpc_clnt *clnt, int flags); | 142 | int rpc_ping(struct rpc_clnt *clnt, int flags); |
139 | 143 | ||
140 | static __inline__ | ||
141 | int rpc_call(struct rpc_clnt *clnt, u32 proc, void *argp, void *resp, int flags) | ||
142 | { | ||
143 | struct rpc_message msg = { | ||
144 | .rpc_proc = &clnt->cl_procinfo[proc], | ||
145 | .rpc_argp = argp, | ||
146 | .rpc_resp = resp, | ||
147 | .rpc_cred = NULL | ||
148 | }; | ||
149 | return rpc_call_sync(clnt, &msg, flags); | ||
150 | } | ||
151 | |||
152 | extern void rpciod_wake_up(void); | ||
153 | |||
154 | /* | 144 | /* |
155 | * Helper function for NFSroot support | 145 | * Helper function for NFSroot support |
156 | */ | 146 | */ |
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h index 2c3601d31045..1279280d7196 100644 --- a/include/linux/sunrpc/gss_krb5.h +++ b/include/linux/sunrpc/gss_krb5.h | |||
@@ -53,6 +53,8 @@ struct krb5_ctx { | |||
53 | struct xdr_netobj mech_used; | 53 | struct xdr_netobj mech_used; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | extern spinlock_t krb5_seq_lock; | ||
57 | |||
56 | #define KG_TOK_MIC_MSG 0x0101 | 58 | #define KG_TOK_MIC_MSG 0x0101 |
57 | #define KG_TOK_WRAP_MSG 0x0201 | 59 | #define KG_TOK_WRAP_MSG 0x0201 |
58 | 60 | ||
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h new file mode 100644 index 000000000000..8f96e9dc369a --- /dev/null +++ b/include/linux/sunrpc/metrics.h | |||
@@ -0,0 +1,77 @@ | |||
1 | /* | ||
2 | * linux/include/linux/sunrpc/metrics.h | ||
3 | * | ||
4 | * Declarations for RPC client per-operation metrics | ||
5 | * | ||
6 | * Copyright (C) 2005 Chuck Lever <cel@netapp.com> | ||
7 | * | ||
8 | * RPC client per-operation statistics provide latency and retry | ||
9 | * information about each type of RPC procedure in a given RPC program. | ||
10 | * These statistics are not for detailed problem diagnosis, but simply | ||
11 | * to indicate whether the problem is local or remote. | ||
12 | * | ||
13 | * These counters are not meant to be human-readable, but are meant to be | ||
14 | * integrated into system monitoring tools such as "sar" and "iostat". As | ||
15 | * such, the counters are sampled by the tools over time, and are never | ||
16 | * zeroed after a file system is mounted. Moving averages can be computed | ||
17 | * by the tools by taking the difference between two instantaneous samples | ||
18 | * and dividing that by the time between the samples. | ||
19 | * | ||
20 | * The counters are maintained in a single array per RPC client, indexed | ||
21 | * by procedure number. There is no need to maintain separate counter | ||
22 | * arrays per-CPU because these counters are always modified behind locks. | ||
23 | */ | ||
24 | |||
25 | #ifndef _LINUX_SUNRPC_METRICS_H | ||
26 | #define _LINUX_SUNRPC_METRICS_H | ||
27 | |||
28 | #include <linux/seq_file.h> | ||
29 | |||
30 | #define RPC_IOSTATS_VERS "1.0" | ||
31 | |||
32 | struct rpc_iostats { | ||
33 | /* | ||
34 | * These counters give an idea about how many request | ||
35 | * transmissions are required, on average, to complete that | ||
36 | * particular procedure. Some procedures may require more | ||
37 | * than one transmission because the server is unresponsive, | ||
38 | * the client is retransmitting too aggressively, or the | ||
39 | * requests are large and the network is congested. | ||
40 | */ | ||
41 | unsigned long om_ops, /* count of operations */ | ||
42 | om_ntrans, /* count of RPC transmissions */ | ||
43 | om_timeouts; /* count of major timeouts */ | ||
44 | |||
45 | /* | ||
46 | * These count how many bytes are sent and received for a | ||
47 | * given RPC procedure type. This indicates how much load a | ||
48 | * particular procedure is putting on the network. These | ||
49 | * counts include the RPC and ULP headers, and the request | ||
50 | * payload. | ||
51 | */ | ||
52 | unsigned long long om_bytes_sent, /* count of bytes out */ | ||
53 | om_bytes_recv; /* count of bytes in */ | ||
54 | |||
55 | /* | ||
56 | * The length of time an RPC request waits in queue before | ||
57 | * transmission, the network + server latency of the request, | ||
58 | * and the total time the request spent from init to release | ||
59 | * are measured. | ||
60 | */ | ||
61 | unsigned long long om_queue, /* jiffies queued for xmit */ | ||
62 | om_rtt, /* jiffies for RPC RTT */ | ||
63 | om_execute; /* jiffies for RPC execution */ | ||
64 | } ____cacheline_aligned; | ||
65 | |||
66 | struct rpc_task; | ||
67 | struct rpc_clnt; | ||
68 | |||
69 | /* | ||
70 | * EXPORTed functions for managing rpc_iostats structures | ||
71 | */ | ||
72 | struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); | ||
73 | void rpc_count_iostats(struct rpc_task *); | ||
74 | void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); | ||
75 | void rpc_free_iostats(struct rpc_iostats *); | ||
76 | |||
77 | #endif /* _LINUX_SUNRPC_METRICS_H */ | ||
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index 63929349571f..2c2189cb30aa 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
@@ -45,6 +45,8 @@ extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *); | |||
45 | extern int rpc_rmdir(char *); | 45 | extern int rpc_rmdir(char *); |
46 | extern struct dentry *rpc_mkpipe(char *, void *, struct rpc_pipe_ops *, int flags); | 46 | extern struct dentry *rpc_mkpipe(char *, void *, struct rpc_pipe_ops *, int flags); |
47 | extern int rpc_unlink(char *); | 47 | extern int rpc_unlink(char *); |
48 | extern struct vfsmount *rpc_get_mount(void); | ||
49 | extern void rpc_put_mount(void); | ||
48 | 50 | ||
49 | #endif | 51 | #endif |
50 | #endif | 52 | #endif |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 8b25629accd8..82a91bb22362 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -86,6 +86,12 @@ struct rpc_task { | |||
86 | struct work_struct tk_work; /* Async task work queue */ | 86 | struct work_struct tk_work; /* Async task work queue */ |
87 | struct rpc_wait tk_wait; /* RPC wait */ | 87 | struct rpc_wait tk_wait; /* RPC wait */ |
88 | } u; | 88 | } u; |
89 | |||
90 | unsigned short tk_timeouts; /* maj timeouts */ | ||
91 | size_t tk_bytes_sent; /* total bytes sent */ | ||
92 | unsigned long tk_start; /* RPC task init timestamp */ | ||
93 | long tk_rtt; /* round-trip time (jiffies) */ | ||
94 | |||
89 | #ifdef RPC_DEBUG | 95 | #ifdef RPC_DEBUG |
90 | unsigned short tk_pid; /* debugging aid */ | 96 | unsigned short tk_pid; /* debugging aid */ |
91 | #endif | 97 | #endif |
@@ -203,6 +209,7 @@ struct rpc_wait_queue { | |||
203 | unsigned char priority; /* current priority */ | 209 | unsigned char priority; /* current priority */ |
204 | unsigned char count; /* # task groups remaining serviced so far */ | 210 | unsigned char count; /* # task groups remaining serviced so far */ |
205 | unsigned char nr; /* # tasks remaining for cookie */ | 211 | unsigned char nr; /* # tasks remaining for cookie */ |
212 | unsigned short qlen; /* total # tasks waiting in queue */ | ||
206 | #ifdef RPC_DEBUG | 213 | #ifdef RPC_DEBUG |
207 | const char * name; | 214 | const char * name; |
208 | #endif | 215 | #endif |
@@ -269,13 +276,13 @@ void * rpc_malloc(struct rpc_task *, size_t); | |||
269 | void rpc_free(struct rpc_task *); | 276 | void rpc_free(struct rpc_task *); |
270 | int rpciod_up(void); | 277 | int rpciod_up(void); |
271 | void rpciod_down(void); | 278 | void rpciod_down(void); |
272 | void rpciod_wake_up(void); | ||
273 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); | 279 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); |
274 | #ifdef RPC_DEBUG | 280 | #ifdef RPC_DEBUG |
275 | void rpc_show_tasks(void); | 281 | void rpc_show_tasks(void); |
276 | #endif | 282 | #endif |
277 | int rpc_init_mempool(void); | 283 | int rpc_init_mempool(void); |
278 | void rpc_destroy_mempool(void); | 284 | void rpc_destroy_mempool(void); |
285 | extern struct workqueue_struct *rpciod_workqueue; | ||
279 | 286 | ||
280 | static inline void rpc_exit(struct rpc_task *task, int status) | 287 | static inline void rpc_exit(struct rpc_task *task, int status) |
281 | { | 288 | { |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 6ef99b14ff09..7eebbab7160b 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -114,6 +114,7 @@ struct rpc_xprt_ops { | |||
114 | void (*release_request)(struct rpc_task *task); | 114 | void (*release_request)(struct rpc_task *task); |
115 | void (*close)(struct rpc_xprt *xprt); | 115 | void (*close)(struct rpc_xprt *xprt); |
116 | void (*destroy)(struct rpc_xprt *xprt); | 116 | void (*destroy)(struct rpc_xprt *xprt); |
117 | void (*print_stats)(struct rpc_xprt *xprt, struct seq_file *seq); | ||
117 | }; | 118 | }; |
118 | 119 | ||
119 | struct rpc_xprt { | 120 | struct rpc_xprt { |
@@ -187,6 +188,18 @@ struct rpc_xprt { | |||
187 | 188 | ||
188 | struct list_head recv; | 189 | struct list_head recv; |
189 | 190 | ||
191 | struct { | ||
192 | unsigned long bind_count, /* total number of binds */ | ||
193 | connect_count, /* total number of connects */ | ||
194 | connect_start, /* connect start timestamp */ | ||
195 | connect_time, /* jiffies waiting for connect */ | ||
196 | sends, /* how many complete requests */ | ||
197 | recvs, /* how many complete requests */ | ||
198 | bad_xids; /* lookup_rqst didn't find XID */ | ||
199 | |||
200 | unsigned long long req_u, /* average requests on the wire */ | ||
201 | bklog_u; /* backlog queue utilization */ | ||
202 | } stat; | ||
190 | 203 | ||
191 | void (*old_data_ready)(struct sock *, int); | 204 | void (*old_data_ready)(struct sock *, int); |
192 | void (*old_state_change)(struct sock *); | 205 | void (*old_state_change)(struct sock *); |