From: Andrew Morton <akpm@linux-foundation.org>
To: David Hildenbrand <david@redhat.com>
Cc: Andrew Bresticker <abrestic@rivosinc.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm/memory: Don't require head page for do_set_pmd()
Date: Tue, 11 Jun 2024 11:06:22 -0700 [thread overview]
Message-ID: <20240611110622.8e9892e92618ddc36bca11b7@linux-foundation.org> (raw)
In-Reply-To: <8040793f-e9e9-4a2e-807c-afcb310a48f5@redhat.com>
On Tue, 11 Jun 2024 17:33:17 +0200 David Hildenbrand <david@redhat.com> wrote:
> On 11.06.24 17:32, Andrew Bresticker wrote:
> > The requirement that the head page be passed to do_set_pmd() was added
> > in commit ef37b2ea08ac ("mm/memory: page_add_file_rmap() ->
> > folio_add_file_rmap_[pte|pmd]()") and prevents pmd-mapping in the
> > finish_fault() and filemap_map_pages() paths if the page to be inserted
> > is anything but the head page for an otherwise suitable vma and pmd-sized
> > page.
> >
> > Fixes: ef37b2ea08ac ("mm/memory: page_add_file_rmap() -> folio_add_file_rmap_[pte|pmd]()")
> > Signed-off-by: Andrew Bresticker <abrestic@rivosinc.com>
> > ---
> > mm/memory.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/mm/memory.c b/mm/memory.c
> > index 0f47a533014e..a1fce5ddacb3 100644
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@ -4614,8 +4614,9 @@ vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page)
> > if (!thp_vma_suitable_order(vma, haddr, PMD_ORDER))
> > return ret;
> >
> > - if (page != &folio->page || folio_order(folio) != HPAGE_PMD_ORDER)
> > + if (folio_order(folio) != HPAGE_PMD_ORDER)
> > return ret;
> > + page = &folio->page;
> >
> > /*
> > * Just backoff if any subpage of a THP is corrupted otherwise
>
> Acked-by: David Hildenbrand <david@redhat.com>
You know what I'm going to ask ;) I'm assuming that the runtime effects
are "small performance optimization" and that "should we backport the
fix" is "no".
next prev parent reply other threads:[~2024-06-11 18:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 15:32 Andrew Bresticker
2024-06-11 15:33 ` David Hildenbrand
2024-06-11 18:06 ` Andrew Morton [this message]
2024-06-11 18:22 ` Matthew Wilcox
2024-06-11 20:07 ` Andrew Morton
2024-06-11 21:18 ` Hugh Dickins
2024-06-12 18:41 ` David Hildenbrand
2024-08-19 8:16 ` Vincent Donnefort
2024-08-20 20:33 ` Hugh Dickins
2024-06-11 18:03 ` Matthew Wilcox
2024-06-11 18:21 ` Andrew Morton
2024-06-11 18:38 ` Matthew Wilcox
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=20240611110622.8e9892e92618ddc36bca11b7@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=abrestic@rivosinc.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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