aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <cel@netapp.com>2006-03-20 13:44:15 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:15 -0500
commite19b63dafdf7d615b0d36b90990a07e7792b9d3a (patch)
tree45474992fd5d6a1f4c4c49068ec6383429618515
parent67ec9f46b889bfb1ab0a4e307d53929d5f0692bf (diff)
SUNRPC: track length of RPC wait queues
RPC wait queue length will eventually be exported to userland via the RPC iostats interface. Test plan: Compile kernel with CONFIG_NFS enabled. Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--include/linux/sunrpc/sched.h1
-rw-r--r--net/sunrpc/sched.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index a390c9b8a01e..6c23f73a799a 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -203,6 +203,7 @@ struct rpc_wait_queue {
203 unsigned char priority; /* current priority */ 203 unsigned char priority; /* current priority */
204 unsigned char count; /* # task groups remaining serviced so far */ 204 unsigned char count; /* # task groups remaining serviced so far */
205 unsigned char nr; /* # tasks remaining for cookie */ 205 unsigned char nr; /* # tasks remaining for cookie */
206 unsigned short qlen; /* total # tasks waiting in queue */
206#ifdef RPC_DEBUG 207#ifdef RPC_DEBUG
207 const char * name; 208 const char * name;
208#endif 209#endif
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 1b74420d1603..aa0449dcd8e5 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -181,6 +181,7 @@ static void __rpc_add_wait_queue(struct rpc_wait_queue *queue, struct rpc_task *
181 else 181 else
182 list_add_tail(&task->u.tk_wait.list, &queue->tasks[0]); 182 list_add_tail(&task->u.tk_wait.list, &queue->tasks[0]);
183 task->u.tk_wait.rpc_waitq = queue; 183 task->u.tk_wait.rpc_waitq = queue;
184 queue->qlen++;
184 rpc_set_queued(task); 185 rpc_set_queued(task);
185 186
186 dprintk("RPC: %4d added to queue %p \"%s\"\n", 187 dprintk("RPC: %4d added to queue %p \"%s\"\n",
@@ -215,6 +216,7 @@ static void __rpc_remove_wait_queue(struct rpc_task *task)
215 __rpc_remove_wait_queue_priority(task); 216 __rpc_remove_wait_queue_priority(task);
216 else 217 else
217 list_del(&task->u.tk_wait.list); 218 list_del(&task->u.tk_wait.list);
219 queue->qlen--;
218 dprintk("RPC: %4d removed from queue %p \"%s\"\n", 220 dprintk("RPC: %4d removed from queue %p \"%s\"\n",
219 task->tk_pid, queue, rpc_qname(queue)); 221 task->tk_pid, queue, rpc_qname(queue));
220} 222}