[NET]: Rate limiting for socket allocation failure messages.

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

Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Akinobu Mita 2006-08-31 15:21:50 -07:00 committed by David S. Miller
parent 99c7bc0133
commit 5991c84421
1 changed files with 2 additions and 1 deletions

View File

@ -1178,6 +1178,7 @@ static int __sock_create(int family, int type, int protocol, struct socket **res
*/
if (!(sock = sock_alloc())) {
if (net_ratelimit())
printk(KERN_WARNING "socket: no more sockets\n");
err = -ENFILE; /* Not exactly a match, but its the
closest posix thing */