Re: [PATCH v3 03/11] mm: memcontrol: constify the lruvec helpers

From: Muchun Song

Date: Tue Sep 15 2026 - 22:33:16 EST




> On Sep 16, 2026, at 07:20, Tal Zussman <tz2294@xxxxxxxxxxxx> wrote:
>
> The lruvec lookup helpers only read from the memcg, folio, or lruvec
> they are given. Constify them, along with lruvec_pgdat() and the folio
> argument of the folio_lruvec_relock_irq() helpers. mem_cgroup_lruvec()
> may update lruvec->pgdat for a newly onlined node, but that lives in
> the per-node structure, not the memcg. Similarly, lruvec_pgdat() still
> returns a non-const pgdat and does not use container_of_const().
>
> Use container_of_const() in lruvec_memcg() and
> mem_cgroup_get_zone_lru_size(), so the const isn't silently cast away.
>
> Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>

Reviewed-by: Muchun Song <muchun.song@xxxxxxxxx>

Thanks