Re: [PATCH v2 00/28] Eliminate Dying Memory Cgroup

From: Yosry Ahmed
Date: Wed Dec 24 2025 - 09:51:27 EST


December 24, 2025 at 12:43 AM, "Harry Yoo" <harry.yoo@xxxxxxxxxx> wrote:


>
> On Tue, Dec 23, 2025 at 08:04:50PM +0000, Yosry Ahmed wrote:
>
> >
> > I think there might be a problem with non-hierarchical stats on cgroup
> > v1, I brought it up previously [*]. I am not sure if this was addressed
> > but I couldn't immediately find anything.
> >
> Hi, Yosry. Thanks for bringing this up!
>
> >
> > In short, if memory is charged to a dying cgroup at the time of
> > reparenting, when the memory gets uncharged the stats updates will occur
> > at the parent. This will update both hierarchical and non-hierarchical
> > stats of the parent, which would corrupt the parent's non-hierarchical
> > stats (because those counters were never incremented when the memory was
> > charged).
> >
> Hmm, I wonder if this only applies to LRU pages.
>
> In theory we should have this problem for NR_SLAB{UN,}RECLAIMABLE_B
> because we already reparent objcgs, or am I missing something?

We do, but we don't expose these stats in cgroup v1, and we don't expose non-hierarchical stats in cgroup v2.