Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2014 22:36:17 +0000 (UTC)
From:      Hiren Panchasara <hiren@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r262579 - stable/9/sys/kern
Message-ID:  <201402272236.s1RMaHeF017428@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402272236.s1RMaHeF017428>