[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ucymjttvagptmpmf623q3zhsoxfhes6kprsgfbdtr5rf3otat7@trcc4vhtyswa>
Date: Thu, 16 Oct 2025 08:19:50 -0700
From: Shakeel Butt <shakeel.butt@...ux.dev>
To: Kuniyuki Iwashima <kuniyu@...gle.com>
Cc: Roman Gushchin <roman.gushchin@...ux.dev>,
Andrew Morton <akpm@...ux-foundation.org>, Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>, Muchun Song <muchun.song@...ux.dev>, Tejun Heo <tj@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Willem de Bruijn <willemb@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
"David S . Miller" <davem@...emloft.net>, Matyas Hurtik <matyas.hurtik@...77.com>,
Daniel Sedlak <daniel.sedlak@...77.com>, Simon Horman <horms@...nel.org>,
Neal Cardwell <ncardwell@...gle.com>, Wei Wang <weibunny@...a.com>, netdev@...r.kernel.org,
linux-mm@...ck.org, cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
Meta kernel team <kernel-team@...a.com>
Subject: Re: [PATCH] memcg: net: track network throttling due to memcg memory
pressure
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@...ux.dev> wrote:
> >
> > Shakeel Butt <shakeel.butt@...ux.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@...ux.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@...ux.dev>
>
> +1 for sock_ like "sock" in memory.stat and its MEMCG_SOCK.
>
> Reviewed-by: Kuniyuki Iwashima <kuniyu@...gle.com>
>
Thanks Roman and Kuniyuki, will change the name to sock_throttled in v2.
Powered by blists - more mailing lists