From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Yang Shi <shy828301@gmail.com>
Cc: Song Liu <songliubraving@fb.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux MM <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
matthew.wilcox@oracle.com, kernel-team@fb.com,
william.kucharski@oracle.com,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: Re: [PATCH v2 4/5] mm/thp: allow drop THP from page cache
Date: Fri, 18 Oct 2019 16:32:31 +0300 [thread overview]
Message-ID: <20191018133231.vifgnueulyo57vpy@box> (raw)
In-Reply-To: <CAHbLzkoTT4p9u__EdFgt7_47NHOV5r=nB8EmvBx+1TcyzX5RJg@mail.gmail.com>
On Thu, Oct 17, 2019 at 02:46:38PM -0700, Yang Shi wrote:
> On Thu, Oct 17, 2019 at 9:42 AM Song Liu <songliubraving@fb.com> wrote:
> >
> > From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> >
> > Once a THP is added to the page cache, it cannot be dropped via
> > /proc/sys/vm/drop_caches. Fix this issue with proper handling in
> > invalidate_mapping_pages().
> >
> > Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS")
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> > Tested-by: Song Liu <songliubraving@fb.com>
> > Signed-off-by: Song Liu <songliubraving@fb.com>
> > ---
> > mm/truncate.c | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/mm/truncate.c b/mm/truncate.c
> > index 8563339041f6..dd9ebc1da356 100644
> > --- a/mm/truncate.c
> > +++ b/mm/truncate.c
> > @@ -592,6 +592,16 @@ unsigned long invalidate_mapping_pages(struct address_space *mapping,
> > unlock_page(page);
> > continue;
> > }
> > +
> > + /* Take a pin outside pagevec */
> > + get_page(page);
> > +
> > + /*
> > + * Drop extra pins before trying to invalidate
> > + * the huge page.
> > + */
> > + pagevec_remove_exceptionals(&pvec);
> > + pagevec_release(&pvec);
>
> Shall we skip the outer pagevec_remove_exceptions() if it has been done here?
It will be NOP and skipping would complicate the code.
--
Kirill A. Shutemov
next prev parent reply other threads:[~2019-10-18 13:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-17 16:42 [PATCH v2 0/5] Fixes for THP in page cache Song Liu
2019-10-17 16:42 ` [PATCH v2 1/5] proc/meminfo: fix output alignment Song Liu
2019-10-17 17:37 ` Yang Shi
2019-10-17 16:42 ` [PATCH v2 2/5] mm/thp: fix node page state in split_huge_page_to_list() Song Liu
2019-10-17 17:38 ` Yang Shi
2019-10-17 16:42 ` [PATCH v2 3/5] mm: Support removing arbitrary sized pages from mapping Song Liu
2019-10-17 17:43 ` Yang Shi
2019-10-17 16:42 ` [PATCH v2 4/5] mm/thp: allow drop THP from page cache Song Liu
2019-10-17 21:46 ` Yang Shi
2019-10-18 13:32 ` Kirill A. Shutemov [this message]
2019-10-18 21:54 ` Yang Shi
2019-10-17 16:42 ` [PATCH v2 5/5] uprobe: only do FOLL_SPLIT_PMD for uprobe register Song Liu
2019-10-18 12:52 ` Srikar Dronamraju
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=20191018133231.vifgnueulyo57vpy@box \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=kernel-team@fb.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.wilcox@oracle.com \
--cc=shy828301@gmail.com \
--cc=songliubraving@fb.com \
--cc=william.kucharski@oracle.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;
as well as URLs for NNTP newsgroup(s).