From: Daniel Sedlak <daniel.sedlak@cdn77.com>
To: Shakeel Butt <shakeel.butt@linux.dev>,
Kuniyuki Iwashima <kuniyu@google.com>
Cc: "Michal Koutný" <mkoutny@suse.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>,
"Roman Gushchin" <roman.gushchin@linux.dev>,
"Muchun Song" <muchun.song@linux.dev>,
cgroups@vger.kernel.org,
"Matyas Hurtik" <matyas.hurtik@cdn77.com>
Subject: Re: [PATCH v3] memcg: expose socket memory pressure in a cgroup
Date: Wed, 23 Jul 2025 10:41:30 +0200 [thread overview]
Message-ID: <01ab2653-dbff-4a3f-ac91-f3f21a06dd2e@cdn77.com> (raw)
In-Reply-To: <4g63mbix4aut7ye7b7s4m5q7aewfxq542i2vygniow7l5a3zmd@bvis5wmifscy>
On 7/22/25 9:05 PM, Shakeel Butt wrote:
> On Tue, Jul 22, 2025 at 11:27:39AM -0700, Kuniyuki Iwashima wrote:
>> On Tue, Jul 22, 2025 at 10:50 AM Shakeel Butt <shakeel.butt@linux.dev> wrote:
>>>
>>> On Tue, Jul 22, 2025 at 10:57:31AM +0200, Michal Koutný wrote:
>>>> Hello Daniel.
>>>>
>>>> On Tue, Jul 22, 2025 at 09:11:46AM +0200, Daniel Sedlak <daniel.sedlak@cdn77.com> wrote:
>>>>> /sys/fs/cgroup/**/<cgroup name>/memory.net.socket_pressure
>>>>>
>>>>> The output value is an integer matching the internal semantics of the
>>>>> struct mem_cgroup for socket_pressure. It is a periodic re-arm clock,
>>>>> representing the end of the said socket memory pressure, and once the
>>>>> clock is re-armed it is set to jiffies + HZ.
>>>>
>>>> I don't find it ideal to expose this value in its raw form that is
>>>> rather an implementation detail.
>>>>
>>>> IIUC, the information is possibly valid only during one jiffy interval.
>>>> How would be the userspace consuming this?
>>>>
>>>> I'd consider exposing this as a cummulative counter in memory.stat for
>>>> simplicity (or possibly cummulative time spent in the pressure
>>>> condition).
>>>>
>>>> Shakeel, how useful is this vmpressure per-cgroup tracking nowadays? I
>>>> thought it's kind of legacy.
>>>
>>>
>>> Yes vmpressure is legacy and we should not expose raw underlying number
>>> to the userspace. How about just 0 or 1 and use
>>> mem_cgroup_under_socket_pressure() underlying? In future if we change
>>> the underlying implementation, the output of this interface should be
>>> consistent.
>>
>> But this is available only for 1 second, and it will not be useful
>> except for live debugging ?
>
> 1 second is the current implementation and it can be more if the memcg
> remains in memory pressure.
In our production environment, when this so-called pressure happens, it
typically stays under pressure for a few hours straight. So, in our
scenario, even a 1 or 0 would be helpful since it does not oscillate.
prev parent reply other threads:[~2025-07-23 8:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 7:11 [PATCH v3] memcg: expose socket memory pressure in a cgroup Daniel Sedlak
2025-07-22 7:17 ` Eric Dumazet
2025-07-22 7:27 ` Daniel Sedlak
2025-07-22 8:57 ` Michal Koutný
2025-07-22 17:50 ` Shakeel Butt
2025-07-22 18:27 ` Kuniyuki Iwashima
2025-07-22 18:41 ` Waiman Long
2025-07-22 18:49 ` Kuniyuki Iwashima
2025-07-22 19:05 ` Shakeel Butt
2025-07-22 19:58 ` Kuniyuki Iwashima
2025-07-22 20:11 ` Shakeel Butt
2025-07-22 22:10 ` Kuniyuki Iwashima
2025-07-23 8:38 ` Michal Koutný
2025-07-23 8:58 ` Daniel Sedlak
2025-07-23 17:54 ` Shakeel Butt
2025-07-24 8:43 ` Daniel Sedlak
2025-07-25 0:44 ` Tejun Heo
2025-07-28 11:29 ` Daniel Sedlak
2025-07-30 0:15 ` Tejun Heo
2025-07-23 8:41 ` Daniel Sedlak [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=01ab2653-dbff-4a3f-ac91-f3f21a06dd2e@cdn77.com \
--to=daniel.sedlak@cdn77.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=corbet@lwn.net \
--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=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).