From: Roman Gushchin <roman.gushchin@linux.dev>
To: Kuniyuki Iwashima <kuniyu@google.com>
Cc: "Shakeel Butt" <shakeel.butt@linux.dev>,
"Daniel Sedlak" <daniel.sedlak@cdn77.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Neal Cardwell" <ncardwell@google.com>,
"David Ahern" <dsahern@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Yosry Ahmed" <yosry.ahmed@linux.dev>,
linux-mm@kvack.org, netdev@vger.kernel.org,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Hocko" <mhocko@kernel.org>,
"Muchun Song" <muchun.song@linux.dev>,
cgroups@vger.kernel.org, "Tejun Heo" <tj@kernel.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Matyas Hurtik" <matyas.hurtik@cdn77.com>
Subject: Re: [PATCH v5] memcg: expose socket memory pressure in a cgroup
Date: Wed, 15 Oct 2025 13:17:36 -0700 [thread overview]
Message-ID: <87a51rapi7.fsf@linux.dev> (raw)
In-Reply-To: <CAAVpQUCNV96vOReAeVHpwbUg9XJDLRTkHmcABh9dhm=f8p5O+g@mail.gmail.com> (Kuniyuki Iwashima's message of "Wed, 15 Oct 2025 11:58:23 -0700")
Kuniyuki Iwashima <kuniyu@google.com> writes:
> On Wed, Oct 15, 2025 at 11:39 AM Shakeel Butt <shakeel.butt@linux.dev> wrote:
>>
>> On Wed, Oct 15, 2025 at 11:21:17AM -0700, Kuniyuki Iwashima wrote:
>> > On Tue, Oct 14, 2025 at 1:33 PM Shakeel Butt <shakeel.butt@linux.dev> wrote:
>> > >
>> > > On Mon, Oct 13, 2025 at 04:30:53PM +0200, Daniel Sedlak wrote:
>> > > [...]
>> > > > > > > > How about we track the actions taken by the callers of
>> > > > > > > > mem_cgroup_sk_under_memory_pressure()? Basically if network stack
>> > > > > > > > reduces the buffer size or whatever the other actions it may take when
>> > > > > > > > mem_cgroup_sk_under_memory_pressure() returns, tracking those actions
>> > > > > > > > is what I think is needed here, at least for the debugging use-case.
>> > > >
>> > > > I am not against it, but I feel that conveying those tracked actions (or how
>> > > > to represent them) to the user will be much harder. Are there already
>> > > > existing APIs to push this information to the user?
>> > > >
>> > >
>> > > I discussed with Wei Wang and she suggested we should start tracking the
>> > > calls to tcp_adjust_rcv_ssthresh() first. So, something like the
>> > > following. I would like feedback frm networking folks as well:
>> >
>> > I think we could simply put memcg_memory_event() in
>> > mem_cgroup_sk_under_memory_pressure() when it returns
>> > true.
>> >
>> > Other than tcp_adjust_rcv_ssthresh(), if tcp_under_memory_pressure()
>> > returns true, it indicates something bad will happen, failure to expand
>> > rcvbuf and sndbuf, need to prune out-of-order queue more aggressively,
>> > FIN deferred to a retransmitted packet.
>> >
>> > Also, we could cover mptcp and sctp too.
>> >
>>
>> I wanted to start simple and focus on one specific action but I am open
>> to other actins as well. Do we want a generic network throttled metric
>> or do we want different metric for different action? At the moment I
>> think for memcg, a single metric would be sufficient and then we can
>> have tracepoints for more fine grained debugging.
>
> I agree that a single metric would be enough if it can signal
> something bad is happening as a first step, then we can take
> further action with tracepoint, bpftrace, whatever.
+1 to a single metric
prev parent reply other threads:[~2025-10-15 20:17 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 12:50 [PATCH v5] memcg: expose socket memory pressure in a cgroup Daniel Sedlak
2025-10-07 20:01 ` Tejun Heo
2025-10-08 12:46 ` Matyas Hurtik
2025-10-08 18:17 ` Tejun Heo
2025-10-08 18:58 ` Roman Gushchin
2025-10-09 14:44 ` Daniel Sedlak
2025-10-09 15:32 ` Roman Gushchin
2025-10-09 16:06 ` Shakeel Butt
2025-10-09 17:58 ` Roman Gushchin
2025-10-09 18:32 ` Shakeel Butt
2025-10-09 19:02 ` Roman Gushchin
2025-10-13 14:30 ` Daniel Sedlak
2025-10-14 1:43 ` Roman Gushchin
2025-10-14 13:58 ` Daniel Sedlak
2025-10-14 20:32 ` Shakeel Butt
2025-10-15 13:57 ` Daniel Sedlak
2025-10-15 18:36 ` Shakeel Butt
2025-10-15 18:21 ` Kuniyuki Iwashima
2025-10-15 18:39 ` Shakeel Butt
2025-10-15 18:58 ` Kuniyuki Iwashima
2025-10-15 20:17 ` Roman Gushchin [this message]
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=87a51rapi7.fsf@linux.dev \
--to=roman.gushchin@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=daniel.sedlak@cdn77.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=hannes@cmpxchg.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-mm@kvack.org \
--cc=matyas.hurtik@cdn77.com \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=muchun.song@linux.dev \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shakeel.butt@linux.dev \
--cc=tj@kernel.org \
--cc=yosry.ahmed@linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.