Re: [PATCH 1/2] mm/vmpressure: skip tree=true accounting on cgroup v2

From: Usama Arif

Date: Mon Jun 29 2026 - 08:44:23 EST


On Thu, 25 Jun 2026 11:04:15 +0200 Michal Koutný <mkoutny@xxxxxxxx> wrote:

> Hello Usama.
>
> On Sat, Jun 06, 2026 at 04:41:33AM -0700, Usama Arif <usama.arif@xxxxxxxxx> wrote:
> > --- a/mm/vmpressure.c
> > +++ b/mm/vmpressure.c
> > @@ -246,11 +246,13 @@ void vmpressure(gfp_t gfp, int order, struct mem_cgroup *memcg, bool tree,
> > return;
> >
> > /*
> > - * The in-kernel users only care about the reclaim efficiency
> > - * for this @memcg rather than the whole subtree, and there
> > - * isn't and won't be any in-kernel user in a legacy cgroup.
> > + * Only two combinations have a consumer:
> > + * cgroup v2 + tree=false -> in-kernel socket pressure
> > + * cgroup v1 + tree=true -> userspace eventfds (memory.pressure_level)
> > + * Skip the other two: nothing consumes the result.
>
> This is a good finding, I had some troubles convincing myself that the
> v2 has really only the memcg->socket_pressure. I think swapping the
> order of the patches would make it easier to comprehend.

Thanks Michal! I realized when trying to swap the order that the splitting off
v1 commit will end up doing more that what I think it should do (just splitting
off v1 specific code), as the tree = true code will not get compiled in at
all for cgroup v2, and it then ends up changing more behaviour. I am sending
the next revision with the current order, but if you have a strong preference,
I will respin with the order reversed.

>
>
> Michal
>