Re: [PATCH 2/2] mm/mglru: reset page lru tier bits when activating

From: Wei Xu
Date: Mon Oct 14 2024 - 19:47:54 EST


On Mon, Oct 14, 2024 at 4:27 PM Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Mon, 14 Oct 2024 22:12:31 +0000 Wei Xu <weixugc@xxxxxxxxxx> wrote:
>
> > folio_activate() calls lru_gen_add_folio() to move the folio to the
> > youngest generation. But unlike folio_update_gen()/folio_inc_gen(),
> > lru_gen_add_folio() doesn't reset the folio lru tier bits
> > (LRU_REFS_MASK | LRU_REFS_FLAGS). Fix this inconsistency in
> > lru_gen_add_folio() when activating a folio.
>
> What are the runtime effects of this flaw?

It can affect how pages get aged via the MGLRU PID controller, though
no bad behaviors clearly related to this have been detected at
runtime. The fix is to address this inconsistency identified via code
inspection.