From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8811F2E62A2; Mon, 1 Dec 2025 11:27:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764588478; cv=none; b=O3VY6bG8EgIGOypEHtQG+VzvNrH3HIVtkHODQKihub+fI3x2HySDn3oM2AGoG4rGfZ5Yn9D5XDxiJbU2V9c/8+AwnHH4SY+iCtMSyV+CUC1gPaKP31bltAYo4AE74jZt+zJjAVr9qrV9fXuWT0WJBacrs3QIKM/yKp57UkhztZM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764588478; c=relaxed/simple; bh=w9InlKm2tbGExTYA9Y3295+Pdc687QZCOPL4T8MDvd0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F3LkQrJZV6Cv6t3mYKI+Dvp/VWQQlN9y/onuiBcwyDR+Rydm4mwm3PWlk5h6Gadujb1bYM741KK2B57N3+dOh95eqU55rYphfBUV9rX4BCm1SZxtPWPhW5Nn5b0kX+eI+ZIuPeetfM3b0jUZVQWI3WEkpqF+pTLWS0sZV+S1Ik8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZqZgQBuo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZqZgQBuo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 159B1C4CEF1; Mon, 1 Dec 2025 11:27:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764588478; bh=w9InlKm2tbGExTYA9Y3295+Pdc687QZCOPL4T8MDvd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZqZgQBuoq7+aJV8chZpIFg7u5RUbn9mwtLZshQ3PVpFFKb0bk3zAfY61903ep+vob Bi9ez2osO6AwJqpcaGxmgcTuNq0O+BdiibfqmNOzXFF8qSPm5H01EAFATFwF5GLCIE JMf/sEvgrFsaCRtDH1An+iO577jS7uNXa9SKcGuI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kuniyuki Iwashima , Eric Dumazet , Shakeel Butt , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 063/187] net: Call trace_sock_exceed_buf_limit() for memcg failure with SK_MEM_RECV. Date: Mon, 1 Dec 2025 12:22:51 +0100 Message-ID: <20251201112243.518243890@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251201112241.242614045@linuxfoundation.org> References: <20251201112241.242614045@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kuniyuki Iwashima [ Upstream commit 9d85c565a7b7c78b732393c02bcaa4d5c275fe58 ] 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 Reviewed-by: Eric Dumazet Reviewed-by: Shakeel Butt Link: https://patch.msgid.link/20250815201712.1745332-5-kuniyu@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/core/sock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/core/sock.c b/net/core/sock.c index 54f9ad391f895..a737cea1835f3 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -2590,8 +2590,7 @@ int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind) return 1; } - 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); -- 2.51.0