From: Yosry Ahmed <yosryahmed@google.com>
To: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
Greg Thelen <gthelen@google.com>,
Facebook Kernel Team <kernel-team@meta.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] memcg: expose children memory usage for root
Date: Fri, 26 Jul 2024 10:43:31 -0700 [thread overview]
Message-ID: <CAJD7tkYCERG5pUTcdmw8UGks8wtK9W9jzZGZODE6sZ-9-WEv-g@mail.gmail.com> (raw)
In-Reply-To: <z2chqotbjp27rtq4c5mrmz3llsn3o523goq4ycy5jt7s4atcdp@xyb34euw2s45>
On Fri, Jul 26, 2024 at 10:30 AM Shakeel Butt <shakeel.butt@linux.dev> wrote:
>
> On Fri, Jul 26, 2024 at 09:25:27AM GMT, Yosry Ahmed wrote:
> > On Fri, Jul 26, 2024 at 8:48 AM Shakeel Butt <shakeel.butt@linux.dev> wrote:
> > >
> [...]
> > >
> > > No, the workloads running in non-root memcgs will not see any
> > > difference. Only the workloads running in root will see charging
> > > overhead.
> >
> > Oh yeah we already charge the root's page counters hierarchically in
> > the upstream kernel, we just do not charge them if the origin of the
> > charge is the root itself.
> >
> > We also have workloads that iterate top-level memcgs to calculate the
> > total charged memory, so memory.children_usage for the root memcg
> > would help.
> >
> > As for memory.current, do you have any data about how much memory is
> > charged to the root itself? We think of the memory charged to the root
> > as system overhead, while the memory charged to top-level memcgs
> > isn't.
> >
> > So basically total_memory - root::memory.children_usage would be a
> > fast way to get a rough estimation of system overhead. The same would
> > not apply for total_memory - root::memory.current if I understand
> > correctly.
>
> Please note that root::memory.children_usage will have top level zombies
> included as well (at least until lru reparenting is not done). So, for
> your example it would provide good estimation of top level zombie memory
> through root::memory.children_usage - top_level(alive)::memory.current.
Good point. The fact that it includes the top-level zombies makes it
less valuable for this use case, as zombie memory is considered system
overhead as well. So we need to iterate the top level memcgs anyway.
next prev parent reply other threads:[~2024-07-26 17:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-22 22:53 Shakeel Butt
2024-07-25 23:12 ` T.J. Mercier
2024-07-26 15:46 ` Shakeel Butt
2024-07-26 16:46 ` T.J. Mercier
2024-07-25 23:20 ` Yosry Ahmed
2024-07-26 15:48 ` Shakeel Butt
2024-07-26 16:25 ` Yosry Ahmed
2024-07-26 16:50 ` T.J. Mercier
2024-07-26 17:18 ` Shakeel Butt
2024-07-26 17:30 ` Shakeel Butt
2024-07-26 17:43 ` Yosry Ahmed [this message]
2024-07-26 18:16 ` 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=CAJD7tkYCERG5pUTcdmw8UGks8wtK9W9jzZGZODE6sZ-9-WEv-g@mail.gmail.com \
--to=yosryahmed@google.com \
--cc=akpm@linux-foundation.org \
--cc=gthelen@google.com \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.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=shakeel.butt@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