summaryrefslogtreecommitdiff
path: root/net/sunrpc/sysfs.c
diff options
context:
space:
mode:
authorOlga Kornievskaia <kolga@netapp.com>2021-06-23 23:28:52 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-07-08 14:03:24 -0400
commit6a2840590b66e4914d583be61e40445386bb5835 (patch)
treed1e1beb16baee8a038a9abdd573674d72b2fe2e5 /net/sunrpc/sysfs.c
parent85e39feead948bdf8322c961d7a9bebc20d629f3 (diff)
sunrpc: display xprt's queuelen of assigned tasks via sysfs
Once a task grabs a trasnport it's reflected in the queuelen of the rpc_xprt structure. Add display of that value in the xprt's info file in sysfs. Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc/sysfs.c')
-rw-r--r--net/sunrpc/sysfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sunrpc/sysfs.c b/net/sunrpc/sysfs.c
index a30ad18aa7dc..b576c7f06829 100644
--- a/net/sunrpc/sysfs.c
+++ b/net/sunrpc/sysfs.c
@@ -113,13 +113,15 @@ static ssize_t rpc_sysfs_xprt_info_show(struct kobject *kobj,
ret = sprintf(buf, "last_used=%lu\ncur_cong=%lu\ncong_win=%lu\n"
"max_num_slots=%u\nmin_num_slots=%u\nnum_reqs=%u\n"
"binding_q_len=%u\nsending_q_len=%u\npending_q_len=%u\n"
- "backlog_q_len=%u\nmain_xprt=%d\nsrc_port=%u\n",
+ "backlog_q_len=%u\nmain_xprt=%d\nsrc_port=%u\n"
+ "tasks_queuelen=%ld\n",
xprt->last_used, xprt->cong, xprt->cwnd, xprt->max_reqs,
xprt->min_reqs, xprt->num_reqs, xprt->binding.qlen,
xprt->sending.qlen, xprt->pending.qlen,
xprt->backlog.qlen, xprt->main,
(xprt->xprt_class->ident == XPRT_TRANSPORT_TCP) ?
- get_srcport(xprt) : 0);
+ get_srcport(xprt) : 0,
+ atomic_long_read(&xprt->queuelen));
xprt_put(xprt);
return ret + 1;
}