public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
To: Ganesan Rajagopal <rganesan-nzgTgzXrdUbQT0dZR+AlfA@public.gmane.org>
Cc: mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org,
	shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org
Subject: Re: [PATCH] mm/memcontrol: Export memcg->watermark via sysfs for v2 memcg
Date: Fri, 6 May 2022 07:56:18 -0700	[thread overview]
Message-ID: <YnU3EuaWCKL5LZLy@cmpxchg.org> (raw)
In-Reply-To: <20220505121329.GA32827-pF7uKtACKh3GmWBmRUYTj5O0Dwfk+90YVpNB7YpNyf8@public.gmane.org>

On Thu, May 05, 2022 at 05:13:30AM -0700, Ganesan Rajagopal wrote:
> v1 memcg exports memcg->watermark as "memory.mem_usage_in_bytes" in
> sysfs. This is missing for v2 memcg though "memory.current" is exported.
> There is no other easy way of getting this information in Linux.
> getrsuage() returns ru_maxrss but that's the max RSS of a single process
> instead of the aggregated max RSS of all the processes. Hence, expose
> memcg->watermark as "memory.watermark" for v2 memcg.
> 
> Signed-off-by: Ganesan Rajagopal <rganesan-nzgTgzXrdUbQT0dZR+AlfA@public.gmane.org>

This wasn't initially added to cgroup2 because its usefulness is very
specific: it's (mostly) useless on limited cgroups, on long-running
cgroups, and on cgroups that are recycled for multiple jobs. And I
expect these categories apply to the majority of cgroup usecases.

However, for the situation where you want to measure the footprint of
a short-lived, unlimited one-off cgroup, there really is no good
alternative. And it's a legitimate usecase. It doesn't cost much to
maintain this info. So I think we should go ahead with this patch.

But please add a blurb to Documentation/admin-guide/cgroup-v2.rst.

  parent reply	other threads:[~2022-05-06 14:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05 12:13 [PATCH] mm/memcontrol: Export memcg->watermark via sysfs for v2 memcg Ganesan Rajagopal
     [not found] ` <20220505121329.GA32827-pF7uKtACKh3GmWBmRUYTj5O0Dwfk+90YVpNB7YpNyf8@public.gmane.org>
2022-05-05 16:12   ` Shakeel Butt
     [not found]     ` <CALvZod5xiSuJaDjGb+NM18puejwhnPWweSj+N=0RGQrjpjfxbw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-05-05 17:27       ` Ganesan Rajagopal
     [not found]         ` <CAPD3tpG1BeTOwTBxkXCxoJagvbn6n1aAEkt0P65g91N9gtK03w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-05-06 15:58           ` Shakeel Butt
2022-05-06 14:56   ` Johannes Weiner [this message]
     [not found]     ` <YnU3EuaWCKL5LZLy-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2022-05-06 15:04       ` Ganesan Rajagopal
2022-05-06 15:56       ` Shakeel Butt
     [not found]         ` <CALvZod6jcdhHqFEo1r-y5QufA+LxeCDy9hnD2ag_8vkvxXtp2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-05-06 16:43           ` Ganesan Rajagopal
     [not found]             ` <CAPD3tpFx9eNUULr79xy1y7=g0zT2jMebuJMVfqyCPUZnpyx2yQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-05-06 16:45               ` Shakeel Butt
     [not found]                 ` <CALvZod4NTiqj2tfge54=oBrYggCzGVJp13RNxr2GDWdpqMCP0w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-05-06 16:58                   ` Ganesan Rajagopal
2022-05-06 20:49           ` Johannes Weiner
     [not found]             ` <YnWJ5QgRyc+Ualjx-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2022-05-06 21:04               ` 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=YnU3EuaWCKL5LZLy@cmpxchg.org \
    --to=hannes-druugvl0lcnafugrpc6u6w@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=rganesan-nzgTgzXrdUbQT0dZR+AlfA@public.gmane.org \
    --cc=roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org \
    --cc=shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    /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