aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/filter.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-02-01 20:47:59 -0800
committerDavid S. Miller <davem@davemloft.net>2017-02-02 23:34:19 -0500
commit8fe809a992639b2013c0d8da2ba55cdea28a959a (patch)
tree6f6fd0428d83432fa0b469773c3b9690cb117d2e /net/core/filter.c
parentnet: ipv4: remove fib_lookup.h from devinet.c include list (diff)
downloadlinux-dev-8fe809a992639b2013c0d8da2ba55cdea28a959a.tar.xz
linux-dev-8fe809a992639b2013c0d8da2ba55cdea28a959a.zip
net: add LINUX_MIB_PFMEMALLOCDROP counter
Debugging issues caused by pfmemalloc is often tedious. Add a new SNMP counter to more easily diagnose these problems. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Josef Bacik <jbacik@fb.com> Acked-by: Josef Bacik <jbacik@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/filter.c')
-rw-r--r--net/core/filter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index 1e00737e3bc3..0b753cbb2536 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -76,9 +76,10 @@ int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap)
* allow SOCK_MEMALLOC sockets to use it as this socket is
* helping free memory
*/
- if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC))
+ if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC)) {
+ NET_INC_STATS(sock_net(sk), LINUX_MIB_PFMEMALLOCDROP);
return -ENOMEM;
-
+ }
err = BPF_CGROUP_RUN_PROG_INET_INGRESS(sk, skb);
if (err)
return err;