[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xlvmvjieqfltqtf5y6y37elcwstrhs6sp7qco2npgucdd4ggus@icfvpgxrwljl>
Date: Mon, 29 Dec 2025 11:52:52 +0100
From: Michal Koutný <mkoutny@...e.com>
To: Qi Zheng <qi.zheng@...ux.dev>
Cc: Shakeel Butt <shakeel.butt@...ux.dev>,
Yosry Ahmed <yosry.ahmed@...ux.dev>, hannes@...xchg.org, hughd@...gle.com, mhocko@...e.com,
roman.gushchin@...ux.dev, muchun.song@...ux.dev, david@...nel.org,
lorenzo.stoakes@...cle.com, ziy@...dia.com, harry.yoo@...cle.com, imran.f.khan@...cle.com,
kamalesh.babulal@...cle.com, axelrasmussen@...gle.com, yuanchu@...gle.com, weixugc@...gle.com,
chenridong@...weicloud.com, akpm@...ux-foundation.org, hamzamahfooz@...ux.microsoft.com,
apais@...ux.microsoft.com, lance.yang@...ux.dev, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org, Qi Zheng <zhengqi.arch@...edance.com>
Subject: Re: [PATCH v2 00/28] Eliminate Dying Memory Cgroup
On Tue, Dec 23, 2025 at 04:36:18PM -0800, Shakeel Butt <shakeel.butt@...ux.dev> wrote:
...
> The core stats update functions are mod_memcg_state() and
> mod_memcg_lruvec_state(). If for v1 only, we add additional check for
> CSS_DYING and go to parent if CSS_DYING is set then shouldn't we avoid
> this issue?
...and go to first !CSS_DYING ancestor :-/ (as the whole chain of memcgs
can be offlined)
IIUC thanks to the reparenting charging (modifying state) to an offlined
memcg should be an exception...
On Mon, Dec 29, 2025 at 05:42:43PM +0800, Qi Zheng <qi.zheng@...ux.dev> wrote:
> > We do reparenting in css_offline() callback and cgroup offlining
> > happen somewhat like this:
> >
> > 1. Set CSS_DYING
> > 2. Trigger percpu ref kill
> > 3. Kernel makes sure css ref killed is seen by all CPUs and then trigger
> > css_offline callback.
>
> it seems that we can add the following to
> mem_cgroup_css_free():
>
> parent->vmstats->state_local += child->vmstats->state_local;
>
> Right? I will continue to take a closer look.
...and the time between offlining and free'ing a memcg should not be
arbitrarily long anymore (right?, the crux of the series).
So only transferring local stats in mem_cgroup_css_free should yield a
correct result after limited time range (with possible underflows
between) with no special precaution for CSS_DYING on charging side.
0.02€,
Michal
Download attachment "signature.asc" of type "application/pgp-signature" (266 bytes)
Powered by blists - more mailing lists