Re: [PATCH] mm: memcontrol: add VM_BUG_ON_FOLIO() to catch lru folio in mem_cgroup_migrate()

From: Shakeel Butt
Date: Fri Jun 14 2024 - 11:09:50 EST


On Fri, Jun 14, 2024 at 09:07:42AM GMT, Baolin Wang wrote:
> The mem_cgroup_migrate() will clear the memcg data of the old folio,
> therefore, the callers must make sure the old folio is no longer on
> the LRU list, otherwise the old folio can not get the correct lruvec
> object without the memcg data, which could lead to potential problems [1].
>
> Thus adding a VM_BUG_ON_FOLIO() to catch this issue.
>
> [1] https://lore.kernel.org/all/5ab860d8ee987955e917748f9d6da525d3b52690.1718326003.git.baolin.wang@xxxxxxxxxxxxxxxxx/
> Suggested-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
> Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>

Acked-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>