提交 e19b63da 编写于 作者: C Chuck Lever 提交者: Trond Myklebust

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: NChuck Lever <cel@netapp.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 67ec9f46
...@@ -203,6 +203,7 @@ struct rpc_wait_queue { ...@@ -203,6 +203,7 @@ struct rpc_wait_queue {
unsigned char priority; /* current priority */ unsigned char priority; /* current priority */
unsigned char count; /* # task groups remaining serviced so far */ unsigned char count; /* # task groups remaining serviced so far */
unsigned char nr; /* # tasks remaining for cookie */ unsigned char nr; /* # tasks remaining for cookie */
unsigned short qlen; /* total # tasks waiting in queue */
#ifdef RPC_DEBUG #ifdef RPC_DEBUG
const char * name; const char * name;
#endif #endif
......
...@@ -181,6 +181,7 @@ static void __rpc_add_wait_queue(struct rpc_wait_queue *queue, struct rpc_task * ...@@ -181,6 +181,7 @@ static void __rpc_add_wait_queue(struct rpc_wait_queue *queue, struct rpc_task *
else else
list_add_tail(&task->u.tk_wait.list, &queue->tasks[0]); list_add_tail(&task->u.tk_wait.list, &queue->tasks[0]);
task->u.tk_wait.rpc_waitq = queue; task->u.tk_wait.rpc_waitq = queue;
queue->qlen++;
rpc_set_queued(task); rpc_set_queued(task);
dprintk("RPC: %4d added to queue %p \"%s\"\n", dprintk("RPC: %4d added to queue %p \"%s\"\n",
...@@ -215,6 +216,7 @@ static void __rpc_remove_wait_queue(struct rpc_task *task) ...@@ -215,6 +216,7 @@ static void __rpc_remove_wait_queue(struct rpc_task *task)
__rpc_remove_wait_queue_priority(task); __rpc_remove_wait_queue_priority(task);
else else
list_del(&task->u.tk_wait.list); list_del(&task->u.tk_wait.list);
queue->qlen--;
dprintk("RPC: %4d removed from queue %p \"%s\"\n", dprintk("RPC: %4d removed from queue %p \"%s\"\n",
task->tk_pid, queue, rpc_qname(queue)); task->tk_pid, queue, rpc_qname(queue));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册