From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (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 3A4AE4A21 for ; Thu, 16 Oct 2025 01:40:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760578824; cv=none; b=gC+KUCli4bLEJSGiGdwZ/pn4mV+dlD8PXdUQJxJeTzPx931PI1KBkRLDwBipRvIU/+uT6QQhEX11/LXzbfA33jJpikwy+n/CmQC3dInOb1Y0qNEYx9ENSXD8oUYFeNZabFBtDxIHNjQXO7kiv25f7PVcwuDIyhFn9SCtT3L0iTc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760578824; c=relaxed/simple; bh=lIa08DDm+ODL68Y7Dc2IuubGF7kPBUWh+ukBXTNTDdE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Oml0VDw8VA4U8jWEtr+7i4sMIlmzfne2yGOItzWUmQ5wcDpeET/FVTO4itQ34XIaW/pGl3vVDDuPkPKyLqx1ABRLDTIgBgei+gzetz0TCRElm7mK70p2AJ+X+NFN1nDl4yd6SQmu/CwNCYHl6BVk1YAVf47Ea787LFTaPGT/L5w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=FVQIDwjy; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="FVQIDwjy" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1760578820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8j77l8B/4CaGghMinMZVNzQZrb0KQZNw9uL/x2i+5pg=; b=FVQIDwjyLwrgfsQ9ZgN0VC3paYaWI3yRv04UlT5EMyyAXUVIr4sKEme9jspNGClnzu0jm8 qpFtRWn8QHyTS2xll53HCNN0IPcGwfXSeux8e7VNKPmGH0ovn67oOqWf9ttLsfGaun+6GR 4HFwY21reLopqPQtP/hmBvQJqGA9/l0= From: Roman Gushchin To: Shakeel Butt Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Muchun Song , Tejun Heo , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , Jakub Kicinski , "David S . Miller" , Matyas Hurtik , Daniel Sedlak , Simon Horman , Neal Cardwell , Wei Wang , netdev@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Meta kernel team Subject: Re: [PATCH] memcg: net: track network throttling due to memcg memory pressure In-Reply-To: <20251016013116.3093530-1-shakeel.butt@linux.dev> (Shakeel Butt's message of "Wed, 15 Oct 2025 18:31:16 -0700") References: <20251016013116.3093530-1-shakeel.butt@linux.dev> Date: Wed, 15 Oct 2025 18:40:12 -0700 Message-ID: <87o6q77hfn.fsf@linux.dev> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT Shakeel Butt writes: > The kernel can throttle network sockets if the memory cgroup associated > with the corresponding socket is under memory pressure. The throttling > actions include clamping the transmit window, failing to expand receive > or send buffers, aggressively prune out-of-order receive queue, FIN > deferred to a retransmitted packet and more. Let's add memcg metric to > indicate track such throttling actions. > > At the moment memcg memory pressure is defined through vmpressure and in > future it may be defined using PSI or we may add more flexible way for > the users to define memory pressure, maybe through ebpf. However the > potential throttling actions will remain the same, so this newly > introduced metric will continue to track throttling actions irrespective > of how memcg memory pressure is defined. > > Signed-off-by: Shakeel Butt > --- > Documentation/admin-guide/cgroup-v2.rst | 4 ++++ > include/linux/memcontrol.h | 1 + > include/net/sock.h | 6 +++++- > kernel/cgroup/cgroup.c | 1 + > mm/memcontrol.c | 3 +++ > 5 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst > index 0e6c67ac585a..057ee95e43ef 100644 > --- a/Documentation/admin-guide/cgroup-v2.rst > +++ b/Documentation/admin-guide/cgroup-v2.rst > @@ -1515,6 +1515,10 @@ The following nested keys are defined. > oom_group_kill > The number of times a group OOM has occurred. > > + socks_throttled > + The number of times network sockets associated with > + this cgroup are throttled. I'd prefer sockets_throttled or sock_throttled. And same for the constant name. Otherwise, Acked-by: Roman Gushchin Thanks!