From: Shakeel Butt <shakeel.butt@linux.dev>
To: Kuniyuki Iwashima <kuniyu@google.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Muchun Song <muchun.song@linux.dev>, Tejun Heo <tj@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>,
Jakub Kicinski <kuba@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
Matyas Hurtik <matyas.hurtik@cdn77.com>,
Daniel Sedlak <daniel.sedlak@cdn77.com>,
Simon Horman <horms@kernel.org>,
Neal Cardwell <ncardwell@google.com>,
Wei Wang <weibunny@meta.com>,
netdev@vger.kernel.org, linux-mm@kvack.org,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
Meta kernel team <kernel-team@meta.com>
Subject: Re: [PATCH] memcg: net: track network throttling due to memcg memory pressure
Date: Thu, 16 Oct 2025 08:19:50 -0700 [thread overview]
Message-ID: <ucymjttvagptmpmf623q3zhsoxfhes6kprsgfbdtr5rf3otat7@trcc4vhtyswa> (raw)
In-Reply-To: <CAAVpQUBXzBKfbH_iqn78k6d7ys9DNrXTVbnYSD4ecuKwgCwk8A@mail.gmail.com>
On Wed, Oct 15, 2025 at 10:46:54PM -0700, Kuniyuki Iwashima wrote:
> On Wed, Oct 15, 2025 at 6:40 PM Roman Gushchin <roman.gushchin@linux.dev> wrote:
> >
> > Shakeel Butt <shakeel.butt@linux.dev> 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 <shakeel.butt@linux.dev>
> > > ---
> > > 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 <roman.gushchin@linux.dev>
>
> +1 for sock_ like "sock" in memory.stat and its MEMCG_SOCK.
>
> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
>
Thanks Roman and Kuniyuki, will change the name to sock_throttled in v2.
next prev parent reply other threads:[~2025-10-16 15:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 1:31 Shakeel Butt
2025-10-16 1:40 ` Roman Gushchin
2025-10-16 5:46 ` Kuniyuki Iwashima
2025-10-16 15:19 ` Shakeel Butt [this message]
2025-10-16 10:42 ` Daniel Sedlak
2025-10-16 16:02 ` Shakeel Butt
2025-10-17 14:15 ` Daniel Sedlak
2025-10-17 21:21 ` Shakeel Butt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ucymjttvagptmpmf623q3zhsoxfhes6kprsgfbdtr5rf3otat7@trcc4vhtyswa \
--to=shakeel.butt@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=daniel.sedlak@cdn77.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hannes@cmpxchg.org \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matyas.hurtik@cdn77.com \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=roman.gushchin@linux.dev \
--cc=tj@kernel.org \
--cc=weibunny@meta.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox