Author: emax
Date: Thu Oct 31 20:33:21 2013
New Revision: 257472
URL: http://svnweb.freebsd.org/changeset/base/257472

Log:
  Rate limit (to once per minute) "Listen queue overflow" message in
  sonewconn().
  
  Reviewed by:  scottl, lstewart
  Obtained from:        Netflix, Inc
  MFC after:    2 weeks

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c Thu Oct 31 20:32:11 2013        (r257471)
+++ head/sys/kern/uipc_socket.c Thu Oct 31 20:33:21 2013        (r257472)
@@ -486,6 +486,10 @@ SYSCTL_INT(_regression, OID_AUTO, sonewc
 struct socket *
 sonewconn(struct socket *head, int connstatus)
 {
+       static struct timeval lastover;
+       static struct timeval overinterval = { 60, 0 };
+       static int overcount;
+
        struct socket *so;
        int over;
 
@@ -497,9 +501,17 @@ sonewconn(struct socket *head, int conns
 #else
        if (over) {
 #endif
-               log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: "
-                   "%i already in queue awaiting acceptance\n",
-                   __func__, head->so_pcb, head->so_qlen);
+               overcount++;
+
+               if (ratecheck(&lastover, &overinterval)) {
+                       log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: "
+                           "%i already in queue awaiting acceptance "
+                           "(%d occurrences)\n",
+                           __func__, head->so_pcb, head->so_qlen, overcount);
+
+                       overcount = 0;
+               }
+
                return (NULL);
        }
        VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p",
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to