On Tue, Aug 27, 2024 at 4:11 PM Kinsey Ho <kinseyho@xxxxxxxxxx> wrote: > > The generation number in struct mem_cgroup_reclaim_iter should be > incremented on every round-trip. Currently, it is possible for a > concurrent reclaimer to jump in at the end of the hierarchy, causing a > traversal restart (resetting the iteration position) without > incrementing the generation number. > > By resetting the position without incrementing the generation, it's > possible for another ongoing mem_cgroup_iter() thread to walk the tree > twice. > > Move the traversal restart such that the generation number is > incremented before the restart. > > Signed-off-by: Kinsey Ho <kinseyho@xxxxxxxxxx> Reviewed-by: T.J. Mercier <tjmercier@xxxxxxxxxx>