Commit 5991c84421f3ea1e281954610a39e4993e5c39e4
Committed by
David S. Miller
1 parent
99c7bc0133
Exists in
master
and in
7 other branches
[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>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
net/socket.c
... | ... | @@ -1178,7 +1178,8 @@ |
1178 | 1178 | */ |
1179 | 1179 | |
1180 | 1180 | if (!(sock = sock_alloc())) { |
1181 | - printk(KERN_WARNING "socket: no more sockets\n"); | |
1181 | + if (net_ratelimit()) | |
1182 | + printk(KERN_WARNING "socket: no more sockets\n"); | |
1182 | 1183 | err = -ENFILE; /* Not exactly a match, but its the |
1183 | 1184 | closest posix thing */ |
1184 | 1185 | goto out; |