linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kairui Song <ryncsn@gmail.com>
To: Yosry Ahmed <yosry.ahmed@linux.dev>, Muchun Song <muchun.song@linux.dev>
Cc: "Johannes Weiner" <hannes@cmpxchg.org>,
	"Hamza Mahfooz" <hamzamahfooz@linux.microsoft.com>,
	linux-mm@kvack.org, "Roman Gushchin" <roman.gushchin@linux.dev>,
	"Shakeel Butt" <shakeel.butt@linux.dev>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Tejun Heo" <tj@kernel.org>, "Michal Koutný" <mkoutny@suse.com>,
	"Michal Hocko" <mhocko@kernel.org>,
	"Zach O'Keefe" <zokeefe@google.com>,
	"Kinsey Ho" <kinseyho@google.com>,
	"Yosry Ahmed" <yosryahmed@google.com>,
	"Allen Pais" <apais@linux.microsoft.com>
Subject: Re: A path forward to cleaning up dying cgroups?
Date: Thu, 6 Feb 2025 12:56:03 +0800	[thread overview]
Message-ID: <CAMgjq7BjBoCWeB-MwUGYA=jLvigZ6tC3pLxz6SHAj3eVcsCgnA@mail.gmail.com> (raw)
In-Reply-To: <Z6Oq47ruBzfQh0do@google.com>

On Thu, Feb 6, 2025 at 2:16 AM Yosry Ahmed <yosry.ahmed@linux.dev> wrote:
>
> On Wed, Feb 05, 2025 at 01:08:42PM -0500, Johannes Weiner wrote:
> > On Wed, Feb 05, 2025 at 12:50:19PM -0500, Hamza Mahfooz wrote:
> > > Cc: Shakeel Butt <shakeel.butt@linux.dev>
> > >
> > > On 2/5/25 12:48, Hamza Mahfooz wrote:
> > > > I was just curious as to what the status of the issue described in [1]
> > > > is. It appears that the last time someone took a stab at it was in [2].
> >
> > If memory serves, the sticking point was whether pages should indeed
> > be reparented on cgroup death, or whether they could be moved
> > arbitrarily to other cgroups that are still using them.
> >
> > It's a bit unfortunate, because the reparenting patches were tested
> > and reviewed, and the arbitrary recharging was just an idea that
> > ttbomk nobody seriously followed up on afterwards.
>
> There was an RFC series [1] for the recharging, but all memcg
> maintainers hated it :P
>
> https://lore.kernel.org/lkml/20230720070825.992023-1-yosryahmed@google.com/

We have been suffering from dying cgroup issues for years too, and I
just saw this series. Will it be a good idea to combine this with
reparenting instead (if we will go with the reparenting approach)?
Using objcg API to charge the folios does help speed up the
reparenting, but also adds some overhead and complexity. Just walking
and reparenting the folios seems a more direct approach.

And another idea is, per our observation, dying cgroups have few pages
that are mapped, as the process has all exited. Most folios are just
cache. Shared mapped pages are minor especially for containers. So a
deferred recharge on access seems good enough? Mapped folios may also
be finally unmap someday and get recharged. And at least this makes
accounting more accurate.


  reply	other threads:[~2025-02-06  4:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-05 17:48 Hamza Mahfooz
2025-02-05 17:50 ` Hamza Mahfooz
2025-02-05 18:08   ` Johannes Weiner
2025-02-05 18:16     ` Yosry Ahmed
2025-02-06  4:56       ` Kairui Song [this message]
2025-02-05 18:31     ` Roman Gushchin
2025-02-05 18:46     ` Shakeel Butt
2025-02-06  3:30       ` Muchun Song
2025-02-06  3:34         ` Waiman Long
2025-02-06 15:51         ` Kamalesh Babulal

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='CAMgjq7BjBoCWeB-MwUGYA=jLvigZ6tC3pLxz6SHAj3eVcsCgnA@mail.gmail.com' \
    --to=ryncsn@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=apais@linux.microsoft.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hamzamahfooz@linux.microsoft.com \
    --cc=hannes@cmpxchg.org \
    --cc=kinseyho@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mkoutny@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=tj@kernel.org \
    --cc=yosry.ahmed@linux.dev \
    --cc=yosryahmed@google.com \
    --cc=zokeefe@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