From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org,
William Kucharski <william.kucharski@oracle.com>
Subject: Re: [PATCH] mm/filemap: Fix filemap_map_pages for THP
Date: Fri, 11 Sep 2020 17:34:28 +0300 [thread overview]
Message-ID: <20200911143428.u7v7tr4vhrvye2id@box> (raw)
In-Reply-To: <20200911012532.24761-1-willy@infradead.org>
On Fri, Sep 11, 2020 at 02:25:32AM +0100, Matthew Wilcox (Oracle) wrote:
> We dereference page->mapping and page->index directly after calling
> find_subpage() and these fields are not valid for tail pages. While
> commit 4101196b19d7 introduced the call to find_subpage(), the problem
> existed prior to this; I'm going to suggest all the way back to when
> THPs first existed.
When hugetmpfs made upstream.
> The user-visible effects of this are almost negligible. To hit it, you
> have to mmap a tmpfs file at an unaligned address and then it's only
> a disabled optimisation causing page faults to happen more frequently
> than they otherwise would.
>
> Fix this by keeping both head and page pointers and checking the
> appropriate one. We could use page_mapping() and page_to_index(),
> but that's higher overhead.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
prev parent reply other threads:[~2020-09-11 14:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-11 1:25 Matthew Wilcox (Oracle)
2020-09-11 14:34 ` Kirill A. Shutemov [this message]
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=20200911143428.u7v7tr4vhrvye2id@box \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=william.kucharski@oracle.com \
--cc=willy@infradead.org \
/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