Re: [PATCH] mm: mglru: fix add unevictable folio to lruvec->lists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 14, 2023 at 9:33 PM 江志国 <justinjiang@xxxxxxxx> wrote:
>
> Hi Yu Zhao:
>
> Thank you for your reply and sharing.

Sorry, wrong link. This is the right one:

https://www.kernel.org/doc/html/latest/mm/unevictable-lru.html#the-unevictable-lru-folio-list

> On Thu, Sep 14, 2023 at 9:19 PM 江志国 <justinjiang@xxxxxxxx> wrote:
> >
> > Hi Yu Zhao:
> >
> > How is the unevictable folio managed in kernel?
>
> https://www.kernel.org/doc/Documentation/vm/unevictable-lru.txt
>
> > On Thu, Sep 14, 2023 at 8:08 AM Zhiguo Jiang <justinjiang@xxxxxxxx> wrote:
> > >
> > > The unevictable folio is not supported to add to lruvec->lists in
> > > lruvec_add_folio().
> > >
> > > So use lruvec_add_folio_tail() instead of lruvec_add_folio() to add
> > > unevictable folio to lruvec->lists in sort_folio().
> > >
> > > Signed-off-by: Zhiguo Jiang <justinjiang@xxxxxxxx>
> > > ---
> > >  mm/vmscan.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)  mode change 100644
> > > =>
> > > 100755 mm/vmscan.c
> > >
> > > diff --git a/mm/vmscan.c b/mm/vmscan.c index
> > > 661615fa709b..a15e45632034
> > > --- a/mm/vmscan.c
> > > +++ b/mm/vmscan.c
> > > @@ -4237,7 +4237,7 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c
> > >                 success = lru_gen_del_folio(lruvec, folio, true);
> > >                 VM_WARN_ON_ONCE_FOLIO(!success, folio);
> > >                 folio_set_unevictable(folio);
> > > -               lruvec_add_folio(lruvec, folio);
> > > +               lruvec_add_folio_tail(lruvec, folio);
> > >                 __count_vm_events(UNEVICTABLE_PGCULLED, delta);
> > >                 return true;
> > >         }
> >
> > NAK.
> >
> > lruvec_add_folio()
> > {
> >         ...
> >
> >         if (lru != LRU_UNEVICTABLE)
> >                 list_add(&folio->lru, &lruvec->lists[lru]); }
> >
> > lruvec_add_folio_tail()
> > {
> >         ...
> >
> >         /* This is not expected to be used on LRU_UNEVICTABLE */
> >         list_add_tail(&folio->lru, &lruvec->lists[lru]); }
> >
> > struct page {
> >         ...
> >                         union {
> >                                 struct list_head lru;
> >
> >                                 /* Or, for the Unevictable "LRU list" slot */
> >                                 struct {
> >         ...
> > }





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux