summaryrefslogtreecommitdiffstats
path: root/net/rds/recv.c
diff options
context:
space:
mode:
authorVenkat Venkatsubra <venkat.x.venkatsubra@oracle.com>2016-07-09 17:36:20 -0700
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>2017-01-02 14:02:56 -0800
commit192a798f52998a643cef84fce0204be56666b0bf (patch)
treea4db3cb8d4d45ea005c06bbb8e6298e3fa03faba /net/rds/recv.c
parentcf657269d311d575eb196c7045579b3443631b8b (diff)
downloadlinux-192a798f52998a643cef84fce0204be56666b0bf.tar.bz2
RDS: add stat for socket recv memory usage
Tracks the receive side memory added to scokets and removed from sockets. Signed-off-by: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Diffstat (limited to 'net/rds/recv.c')
-rw-r--r--net/rds/recv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/rds/recv.c b/net/rds/recv.c
index 9d0666e5fe35..ba19eeeae85a 100644
--- a/net/rds/recv.c
+++ b/net/rds/recv.c
@@ -94,6 +94,10 @@ static void rds_recv_rcvbuf_delta(struct rds_sock *rs, struct sock *sk,
return;
rs->rs_rcv_bytes += delta;
+ if (delta > 0)
+ rds_stats_add(s_recv_bytes_added_to_socket, delta);
+ else
+ rds_stats_add(s_recv_bytes_removed_from_socket, -delta);
now_congested = rs->rs_rcv_bytes > rds_sk_rcvbuf(rs);
rdsdebug("rs %p (%pI4:%u) recv bytes %d buf %d "