linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Chae <matthewc@axis.com>
To: Michal Hocko <mhocko@suse.com>, Matthew Chae <Matthew.Chae@axis.com>
Cc: "Roman Gushchin" <roman.gushchin@linux.dev>,
	"Michal Koutný" <mkoutny@suse.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Shakeel Butt" <shakeelb@google.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	kernel <kernel@axis.com>,
	"Christopher Wong" <Christopher.Wong@axis.com>,
	"Muchun Song" <muchun.song@linux.dev>,
	"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/memcontrol: add memory.peak in cgroup root
Date: Fri, 24 Feb 2023 15:18:49 +0100	[thread overview]
Message-ID: <df9cc4e1-befc-af10-c353-733bec54baf1@axis.com> (raw)
In-Reply-To: <Y/h0GlmeSQ735DxK@dhcp22.suse.cz>

[-- Attachment #1: Type: text/plain, Size: 1997 bytes --]

Hi Michal

Thank you for helping me gain full insight.
It looks like there is no proper way to get the peak memory usage 
recorded without adding any overhead to the system and for all users. 
But I fully understand what you kindly explained. Basically, having low 
memory left doesn't mean a bad situation for the system, So checking the 
peak memory doesn't mean a lot and is not necessary.

Let me check again whether we have any special usecase. otherwise, we 
might need to reconsider this requirement.

Thanks,

Matthew

On 2/24/23 09:23, Michal Hocko wrote:
> On Thu 23-02-23 19:00:57, Matthew Chae wrote:
>> Hi Roman,
>>
>> I'd like to get the peak memory usage recorded overall time, rather than at a certain time.
> Sampling /proc/vmstat should have a minimal overhead and you will get
> not only a single value but also a break down to broad cathegory users
> (LRU, slab, page tables etc.). Unfortunatelly this doesn't cover all the
> users (e.g. direct users of the page allocator are not accounted to any
> specific counter) but it should give you a reasonable idea how is memory
> utilized. Specific metrics really depend on what you are interested in.
>
> Another approach that might give you a different angle to the memory
> consumption is to watch PSI metrics. This will not tell you the peak
> memory usage but it will give you an useful cost model for the memory
> usage. Being low on free memory itself is not a bad thing, i.e. you are
> paying for the amount of memory so it would be rather sub-optimal to not
> use it whole, right? If the memory can be reclaimed easily (e.g. by
> reclaiming idle caches) then the overhead of a high memory utilization
> should be reasonably low so the overal price of the reclaim is worth it.
> On the other hand an over utilized system with a working set size larger
> than the available memory would spend a lot of time reclaiming so the
> performance would drop down.
>
> All that being said the primary question is what is your usecase.

[-- Attachment #2: Type: text/html, Size: 2598 bytes --]

  reply	other threads:[~2023-02-24 14:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23 16:22 Matthew Chae
2023-02-23 17:30 ` Roman Gushchin
2023-02-23 19:00   ` Matthew Chae
2023-02-23 22:00     ` Roman Gushchin
2023-02-24  8:23     ` Michal Hocko
2023-02-24 14:18       ` Matthew Chae [this message]
2023-02-24 15:02         ` Michal Hocko
2023-02-24 15:45           ` Matthew Chae
  -- strict thread matches above, loose matches on Subject: below --
2023-02-21 14:34 Matthew Chae
2023-02-21 15:07 ` Michal Hocko
2023-02-23 14:20 ` Michal Koutný

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=df9cc4e1-befc-af10-c353-733bec54baf1@axis.com \
    --to=matthewc@axis.com \
    --cc=Christopher.Wong@axis.com \
    --cc=Matthew.Chae@axis.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=mkoutny@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeelb@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