]> www.infradead.org Git - users/willy/xarray.git/commitdiff
net: Call trace_sock_exceed_buf_limit() for memcg failure with SK_MEM_RECV.
authorKuniyuki Iwashima <kuniyu@google.com>
Fri, 15 Aug 2025 20:16:12 +0000 (20:16 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Aug 2025 02:20:59 +0000 (19:20 -0700)
Initially, trace_sock_exceed_buf_limit() was invoked when
__sk_mem_raise_allocated() failed due to the memcg limit or the
global limit.

However, commit d6f19938eb031 ("net: expose sk wmem in
sock_exceed_buf_limit tracepoint") somehow suppressed the event
only when memcg failed to charge for SK_MEM_RECV, although the
memcg failure for SK_MEM_SEND still triggers the event.

Let's restore the event for SK_MEM_RECV.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Link: https://patch.msgid.link/20250815201712.1745332-5-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/sock.c

index 7c26ec8dce630f0d24a622a418c15e6594d1babb..380bc1aa69829b99185a6183f1117df53b78b13a 100644 (file)
@@ -3354,8 +3354,7 @@ suppress_allocation:
                }
        }
 
-       if (kind == SK_MEM_SEND || (kind == SK_MEM_RECV && charged))
-               trace_sock_exceed_buf_limit(sk, prot, allocated, kind);
+       trace_sock_exceed_buf_limit(sk, prot, allocated, kind);
 
        sk_memory_allocated_sub(sk, amt);