From: Matthew Chae <matthew.chae@axis.com>
To: Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeelb@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: <kernel@axis.com>, <christopher.wong@axis.com>,
Matthew Chae <matthew.chae@axis.com>,
Muchun Song <muchun.song@linux.dev>, <cgroups@vger.kernel.org>,
<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] mm/memcontrol: add memory.peak in cgroup root
Date: Tue, 21 Feb 2023 15:34:20 +0100 [thread overview]
Message-ID: <20230221143421.10385-1-matthew.chae@axis.com> (raw)
The kernel currently doesn't provide any method to show the overall
system's peak memory usage recorded. Instead, only each slice's peak
memory usage recorded except for cgroup root is shown through each
memory.peak.
Each slice might consume their peak memory at different time. This is
stored at memory.peak in each own slice. The sum of every memory.peak
doesn't mean the total system's peak memory usage recorded. The sum at
certain point without having a peak memory usage in their slice can have
the largest value.
time | slice1 | slice2 | sum
=======================================
t1 | 50 | 200 | 250
---------------------------------------
t2 | 150 | 150 | 300
---------------------------------------
t3 | 180 | 20 | 200
---------------------------------------
t4 | 80 | 20 | 100
memory.peak value of slice1 is 180 and memory.peak value of slice2 is 200.
Only these information are provided through memory.peak value from each
slice without providing the overall system's peak memory usage. The total
sum of these two value is 380, but this doesn't represent the real peak
memory usage of the overall system. The peak value what we want to get is
shown in t2 as 300, which doesn't have any biggest number even in one
slice. Therefore the proper way to show the system's overall peak memory
usage recorded needs to be provided.
Hence, expose memory.peak in the cgrop root in order to allow this.
Co-developed-by: Christopher Wong <christopher.wong@axis.com>
Signed-off-by: Christopher Wong <christopher.wong@axis.com>
Signed-off-by: Matthew Chae <matthew.chae@axis.com>
---
mm/memcontrol.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 73afff8062f9..974fc044a7e7 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6646,7 +6646,6 @@ static struct cftype memory_files[] = {
},
{
.name = "peak",
- .flags = CFTYPE_NOT_ON_ROOT,
.read_u64 = memory_peak_read,
},
{
--
2.20.1
next reply other threads:[~2023-02-21 14:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 14:34 Matthew Chae [this message]
2023-02-21 15:07 ` Michal Hocko
2023-02-21 16:13 ` Sv: " Christopher Wong
2023-02-21 16:16 ` Michal Hocko
2023-02-23 14:20 ` Michal Koutný
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
2023-02-24 15:02 ` Michal Hocko
2023-02-24 15:45 ` Matthew Chae
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=20230221143421.10385-1-matthew.chae@axis.com \
--to=matthew.chae@axis.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=christopher.wong@axis.com \
--cc=hannes@cmpxchg.org \
--cc=kernel@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--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