From: Minchan Kim <minchan@kernel.org>
To: Yang Shi <shy828301@gmail.com>
Cc: "Yu Zhao" <yuzhao@google.com>,
"Matthew Wilcox" <willy@infradead.org>,
"Yin, Fengwei" <fengwei.yin@intel.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
Linux-MM <linux-mm@kvack.org>, 韩天硕 <hantianshuo@iie.ac.cn>,
mawupeng <mawupeng1@huawei.com>
Subject: Re: (resend)WARNING: trying to isolate tail page in isolate_lru_page
Date: Fri, 26 Aug 2022 16:12:29 -0700 [thread overview]
Message-ID: <YwlTXbEeIf/Gjhdg@google.com> (raw)
In-Reply-To: <CAHbLzkpjiYLKY-pU1vistCxd6Dg5snh=mvEdJ6+1ZeNKJu7mow@mail.gmail.com>
On Fri, Aug 26, 2022 at 11:19:37AM -0700, Yang Shi wrote:
> On Fri, Aug 26, 2022 at 10:53 AM Minchan Kim <minchan@kernel.org> wrote:
> >
> > On Fri, Aug 26, 2022 at 11:27:53AM -0600, Yu Zhao wrote:
> > > On Fri, Aug 26, 2022 at 11:15 AM Matthew Wilcox <willy@infradead.org> wrote:
> > > >
> > > > On Fri, Aug 26, 2022 at 11:20:58AM +0800, Yin, Fengwei wrote:
> > > > > On 8/26/2022 2:46 AM, Matthew Wilcox wrote:
> > > > > > There's a number of ways of solving this. I'm interested in seeing
> > > > > > which one Minchan thinks is best.
> > > > >
> > > > > My understanding is:
> > > > > PageTransCompound() return false for compound page if THP is disabled
> > > > > in kernel config. Replacing PageTransCompound() with PageCompound()
> > > > > could work here. But for the long term, folio should be the answer. :).
> > > >
> > > > Yes, ultimately, isolate_lru_page() is going away as an interface
> > > > and one will have to call folio_isolate_lru(). But should
> > > > madvise_cold_or_pageout_pte_range() even be getting called for VMAs
> > > > which are mmaps of af_packet? can_madv_lru_vma() rules out a number
> > > > of different types of VMA; should it also be ruling out af_packet VMAs?
> > >
> > > Agreed.
> > >
> > > > If so, how?
> > >
> > > We should add a reliable helper to tell whether a file VMA is
> > > reclaimable or not. I don't think we have one. Currently MGLRU checks
> > > mapping->a_ops->read_folio for file VMAs to determine whether they are
> > > reclaimable.
> > >
> >
> > Long term, that's better idea(For stable backport, I'd like to go with
> > simple PageLRU check).
> >
> > I wonder it's possible to mix LRU pages and non-struct pages together
> > in a VMA. Otherwise, could we reuse(abuse) VM_MIXEDMAP?
>
> I don't think the mix is going to happen via regular mmap call.
At a quick glance of vm_insert_page, it could change vm_flags
into VM_MIXEDMAP dynamically. I am worry that a driver may
call the vm_insert_page in the vma which already has LRU pages
before so the VMA could have both LRU pages and non-LRU pages
in the VMA. If it's doable, we may miss LRU pages if we filter
VM_MIXEDMAP out in can_madv_lru_vma. Not sure it's common case.
Otherwise, yeah, we may introduce a new vm_flag, something like,
VM_NON_LRU. Just thought.
next prev parent reply other threads:[~2022-08-26 23:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 14:40 韩天硕
2022-08-25 16:50 ` Yu Zhao
2022-08-25 18:23 ` Matthew Wilcox
2022-08-25 18:37 ` Yu Zhao
2022-08-25 18:40 ` Yang Shi
2022-08-25 18:46 ` Matthew Wilcox
2022-08-26 3:20 ` Yin, Fengwei
2022-08-26 16:56 ` Minchan Kim
2022-08-26 18:23 ` Yang Shi
2022-08-26 22:58 ` Minchan Kim
2022-08-27 0:48 ` Yin, Fengwei
2022-08-26 17:15 ` Matthew Wilcox
2022-08-26 17:27 ` Yu Zhao
2022-08-26 17:53 ` Minchan Kim
2022-08-26 17:58 ` Yu Zhao
2022-08-26 18:02 ` Matthew Wilcox
2022-08-26 18:19 ` Yang Shi
2022-08-26 23:12 ` Minchan Kim [this message]
2022-08-27 0:24 ` Yin, Fengwei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YwlTXbEeIf/Gjhdg@google.com \
--to=minchan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=fengwei.yin@intel.com \
--cc=hantianshuo@iie.ac.cn \
--cc=linux-mm@kvack.org \
--cc=mawupeng1@huawei.com \
--cc=shy828301@gmail.com \
--cc=willy@infradead.org \
--cc=yuzhao@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox