* [PATCH] rate limiting for socket allocation failure messages
@ 2006-08-31 9:59 Akinobu Mita
2006-08-31 22:22 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2006-08-31 9:59 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: David Miller
(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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] rate limiting for socket allocation failure messages
2006-08-31 9:59 [PATCH] rate limiting for socket allocation failure messages Akinobu Mita
@ 2006-08-31 22:22 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2006-08-31 22:22 UTC (permalink / raw)
To: mita; +Cc: linux-kernel, netdev
From: Akinobu Mita <mita@miraclelinux.com>
Date: Thu, 31 Aug 2006 18:59:21 +0900
> (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>
Patch applied, thanks a lot.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-31 22:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-31 9:59 [PATCH] rate limiting for socket allocation failure messages Akinobu Mita
2006-08-31 22:22 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).