svn commit: r262579 - stable/9/sys/kern

Hiren Panchasara hiren at FreeBSD.org
Thu Feb 27 22:36:17 UTC 2014


Author: hiren
Date: Thu Feb 27 22:36:16 2014
New Revision: 262579
URL: http://svnweb.freebsd.org/changeset/base/262579

Log:
  MFC r257472
  
  Rate limit (to once per minute) "Listen queue overflow" message in
  sonewconn().

Modified:
  stable/9/sys/kern/uipc_socket.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/uipc_socket.c
==============================================================================
--- stable/9/sys/kern/uipc_socket.c	Thu Feb 27 22:34:09 2014	(r262578)
+++ stable/9/sys/kern/uipc_socket.c	Thu Feb 27 22:36:16 2014	(r262579)
@@ -483,6 +483,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;
 
@@ -494,9 +498,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",


More information about the svn-src-stable-9 mailing list