Re: [PATCH mm-unstable v3 3/5] mm: increment gen # before restarting traversal
From: T.J. Mercier
Date: Wed Aug 28 2024 - 13:49:35 EST
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>