]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/rds: Replace printk in TX path with stat variable
authorYuval Shaia <yuval.shaia@oracle.com>
Fri, 14 Jul 2017 20:41:50 +0000 (23:41 +0300)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 15 Jul 2017 04:31:57 +0000 (21:31 -0700)
Printing in any form is not recommended in data path.
Fix it by replacing printk with a new statistics counter.

Orabug: 26402653

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
Reviewed-by: Avinash Repaka <avinash.repaka@oracle.com>
net/rds/rds.h
net/rds/send.c
net/rds/stats.c

index 264f8b43b46581c1c31e20ea9dd40a870b40c22b..8ea9d60c14b8865fe6c95199772b05b8efc2f591 100644 (file)
@@ -852,6 +852,7 @@ struct rds_statistics {
        uint64_t        s_qos_threshold_exceeded;
        uint64_t        s_recv_bytes_added_to_socket;
        uint64_t        s_recv_bytes_removed_from_socket;
+       uint64_t        s_send_stuck_rm;
 };
 
 /* af_rds.c */
index 1a700869054e7ac3088ff5672864aadb4d10ee15..37c7883822dc6c433b8ea7f4c6b2f0f5e7763f1f 100644 (file)
@@ -249,8 +249,8 @@ restart:
                        same_rm = 0;
                } else {
                        same_rm++;
-                       if ((same_rm >= 4096) && printk_ratelimit()) {
-                               /* printk(KERN_ERR "RDS: Stuck rm\n"); */
+                       if (same_rm >= 4096) {
+                               rds_stats_inc(s_send_stuck_rm);
                                ret = -EAGAIN;
                                break;
                        }
index 0b9a6c365ad4ad367e791acab4234310e3716e23..463e665afd7ba57c8572040be9d5e6445c4191bf 100644 (file)
@@ -78,6 +78,7 @@ static char *rds_stat_names[] = {
        "qos_threshold_exceeded",
        "recv_bytes_added_to_sock",
        "recv_bytes_freed_fromsock",
+       "send_stuck_rm",
 };
 
 void rds_stats_info_copy(struct rds_info_iterator *iter,