Re: [PATCH v2] mm/mglru: fix a no-op lru_gen_clear_refs() call in lru_lazyfree()
From: Barry Song
Date: Tue Oct 27 2026 - 07:45:23 EST
On Tue, Oct 27, 2026 at 3:25 PM Hui Zhu <hui.zhu@xxxxxxxxx> wrote:
[...]
> >> + lru_gen_clear_refs(folio);
> > The only thing I'm not sure about is whether we need
> > if (lru_gen_enabled()) here to keep the semantics consistent
> > with other places where we use it.
> >
> > ...
> > 2 676 mm/folio.c <<deactivate_file_folio>>
> > if (lru_gen_enabled() && lru_gen_clear_refs(folio))
> > 3 695 mm/folio.c <<folio_deactivate>>
> > if (lru_gen_enabled() ? lru_gen_clear_refs(folio) :
> > !folio_test_active(folio))
> >
> > So maybe we still need
> >
> > + if (lru_gen_enabled())
> > lru_gen_clear_refs(folio);
>
> I think we maybe don't need it here. The other two sites consume the
> return value, and that is what the check disambiguates:
>
You’re right. Thanks for the thorough investigation.
Reviewed-by: Barry Song <baohua@xxxxxxxxxx>