All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akinobu Mita <mita@miraclelinux.com>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: David Miller <davem@davemloft.net>
Subject: [PATCH] rate limiting for socket allocation failure messages
Date: Thu, 31 Aug 2006 18:59:21 +0900	[thread overview]
Message-ID: <20060831095921.GA13845@miraclelinux.com> (raw)

(Resending due to local mail server trouble)

This patch limits the warning messages when socket allocation
failures happen. It happens under memory pressure.

Cc: David Miller <davem@davemloft.net>
Signed-off-by: Akinobu Mita <mita@miraclelinux.com>

 net/socket.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: work-shouldfail/net/socket.c
===================================================================
--- work-shouldfail.orig/net/socket.c
+++ work-shouldfail/net/socket.c
@@ -1178,7 +1178,8 @@ static int __sock_create(int family, int
  */
 
 	if (!(sock = sock_alloc())) {
-		printk(KERN_WARNING "socket: no more sockets\n");
+		if (net_ratelimit())
+			printk(KERN_WARNING "socket: no more sockets\n");
 		err = -ENFILE;		/* Not exactly a match, but its the
 					   closest posix thing */
 		goto out;

             reply	other threads:[~2006-08-31 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-31  9:59 Akinobu Mita [this message]
2006-08-31 22:22 ` [PATCH] rate limiting for socket allocation failure messages David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060831095921.GA13845@miraclelinux.com \
    --to=mita@miraclelinux.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.