提交 192a798f 编写于 作者: V Venkat Venkatsubra 提交者: Santosh Shilimkar

RDS: add stat for socket recv memory usage

Tracks the receive side memory added to scokets and removed from sockets.
Signed-off-by: NVenkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
Signed-off-by: NSantosh Shilimkar <santosh.shilimkar@oracle.com>
上级 cf657269
...@@ -631,6 +631,9 @@ struct rds_statistics { ...@@ -631,6 +631,9 @@ struct rds_statistics {
uint64_t s_cong_update_received; uint64_t s_cong_update_received;
uint64_t s_cong_send_error; uint64_t s_cong_send_error;
uint64_t s_cong_send_blocked; uint64_t s_cong_send_blocked;
uint64_t s_recv_bytes_added_to_socket;
uint64_t s_recv_bytes_removed_from_socket;
}; };
/* af_rds.c */ /* af_rds.c */
......
...@@ -94,6 +94,10 @@ static void rds_recv_rcvbuf_delta(struct rds_sock *rs, struct sock *sk, ...@@ -94,6 +94,10 @@ static void rds_recv_rcvbuf_delta(struct rds_sock *rs, struct sock *sk,
return; return;
rs->rs_rcv_bytes += delta; 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); now_congested = rs->rs_rcv_bytes > rds_sk_rcvbuf(rs);
rdsdebug("rs %p (%pI4:%u) recv bytes %d buf %d " rdsdebug("rs %p (%pI4:%u) recv bytes %d buf %d "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册