From: Shakeel Butt <shakeel.butt@linux.dev>
To: "T.J. Mercier" <tjmercier@google.com>
Cc: Yosry Ahmed <yosryahmed@google.com>,
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:18:31 -0700 [thread overview]
Message-ID: <7zijk3p3uw6esihry6d3qqrsahhnxnvvw6aqb56ocgujrj7qwc@f7bileo5sl6x> (raw)
In-Reply-To: <CABdmKX0XtaBCF-Dwv2rJBUTjj1NXOus9CL9k2ubaJRSGM35vTg@mail.gmail.com>
On Fri, Jul 26, 2024 at 09:50:49AM GMT, T.J. Mercier wrote:
> On Fri, Jul 26, 2024 at 9:26 AM Yosry Ahmed <yosryahmed@google.com> wrote:
> >
[...]
> >
> > 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?
>
> Yeah I wonder if we'd be able to see any significant regressions for
> stuff that lives there today if we were to start charging it. I can
> try running a test with Android next week. I guess try_charge() is the
> main thing that would need to change to allow root charges?
>
It would a bit more involved like allocating objcg for the root and
changing memcg_slab_post_alloc_hook() to use root memcg if account flags
are not present. There might some changes needed for list_lru and
reclaim but I have not looked deeper into it yet.
next prev parent reply other threads:[~2024-07-26 17:18 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 [this message]
2024-07-26 17:30 ` Shakeel Butt
2024-07-26 17:43 ` Yosry Ahmed
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=7zijk3p3uw6esihry6d3qqrsahhnxnvvw6aqb56ocgujrj7qwc@f7bileo5sl6x \
--to=shakeel.butt@linux.dev \
--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=tjmercier@google.com \
--cc=yosryahmed@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