[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJD7tkYu5Nm4DETjE1DvwuhAq=C6V=Pv9dx9W_oBw=ihwwTuQg@mail.gmail.com>
Date: Wed, 17 Jan 2024 09:53:41 -0800
From: Yosry Ahmed <yosryahmed@...gle.com>
To: Zhongkun He <hezhongkun.hzk@...edance.com>
Cc: Nhat Pham <nphamcs@...il.com>, akpm@...ux-foundation.org, hannes@...xchg.org,
sjenning@...hat.com, ddstreet@...e.org, vitaly.wool@...sulko.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Chris Li <chrisl@...nel.org>, Michal Hocko <mhocko@...nel.org>
Subject: Re: [External] Re: [PATCH] mm: zswap: fix the lack of page lru flag
in zswap_writeback_entry
On Wed, Jan 17, 2024 at 1:53 AM Zhongkun He
<hezhongkun.hzk@...edance.com> wrote:
>
> > >
> > > Please forgive me for adding additional information about this patch.
> > >
> > > I have finished the opt for introducing a folio_add_lru_tail(), but
> > > there are many
> > > questions:
> > > 1) A new page can be move to LRU only by lru_add_fn, so
> > > folio_add_lru_tail could not add pages to LRU for the following code
> > > in folio_batch_move_lru(),which is added by Alex Shi for
> > > serializing memcg changes in pagevec_lru_move_fn[1].
> > >
> > > /* block memcg migration while the folio moves between lru */
> > > if (move_fn != lru_add_fn && !folio_test_clear_lru(folio))
> > > continue;
> > > To achieve the goal, we need to add a new function like lru_add_fn
> > > which does not have the lru flag and folio_add_lru_tail()
> > > + if (move_fn != lru_add_fn && move_fn != lru_move_tail_fn_new &&
> > > + !folio_test_clear_lru(folio))
> > >
> > > 2) __read_swap_cache_async has six parameters, so there is no space to
> > > add a new one, add_to_lru_head.
> > >
> > > So it seems a bit hacky just for a special case for the reasons above.
> >
> > It's a lot of plumbing for sure. Adding a flag to current task_struct
> > is a less-noisy yet-still-hacky solution. I am not saying we should do
> > it, but it's an option. I am not sure how much task flags we have to
> > spare.
>
> Got it.
Actually this won't really work. Writebak can be asynchronous, so
there would be no logical place to unset the flag.
Powered by blists - more mailing lists