From: Vlastimil Babka <vbabka@suse.cz>
To: Kefeng Wang <wangkefeng.wang@huawei.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Jann Horn <jannh@google.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
linux-mm@kvack.org, Yang Shi <shy828301@gmail.com>,
David Hildenbrand <david@redhat.com>,
Ryan Roberts <ryan.roberts@arm.com>
Subject: Re: [PATCH -next] mm: don't try THP align for FS without get_unmapped_area
Date: Fri, 6 Dec 2024 09:44:58 +0100 [thread overview]
Message-ID: <c69e4147-0aee-407f-84f2-f574f7edf4e6@suse.cz> (raw)
In-Reply-To: <20241206070345.2526501-1-wangkefeng.wang@huawei.com>
On 12/6/24 08:03, Kefeng Wang wrote:
> Commit ed48e87c7df3 ("thp: add thp_get_unmapped_area_vmflags()")
> changes thp_get_unmapped_area() to thp_get_unmapped_area_vmflags()
> in __get_unmapped_area(), which won't setup get_area for anonymous
> mappings, but it leads to always try THP align when file ops without
> '.get_unmapped_area' callback too as the get_area is NULL.
>
> Since commit efa7df3e3bb5 ("mm: align larger anonymous mappings on
> THP boundaries") only want to enable THP align for anonymous, adding
> !file check to fix it.
>
> Fixes: ed48e87c7df3 ("thp: add thp_get_unmapped_area_vmflags()")
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Yeah, well spotted.
Cc stable as we did for the others?
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
> ---
> mm/mmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 1c6bdffa13dd..b373486bd1c6 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -782,7 +782,7 @@ __get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
>
> if (get_area) {
> addr = get_area(file, addr, len, pgoff, flags);
> - } else if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)
> + } else if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && !file
> && !addr /* no hint */
> && IS_ALIGNED(len, PMD_SIZE)) {
> /* Ensures that larger anonymous mappings are THP aligned. */
next prev parent reply other threads:[~2024-12-06 8:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 7:03 Kefeng Wang
2024-12-06 8:44 ` Vlastimil Babka [this message]
2024-12-06 16:28 ` Yang Shi
2024-12-07 6:34 ` Andrew Morton
2024-12-09 5:00 ` Kefeng Wang
2024-12-09 8:36 ` Vlastimil Babka
2024-12-09 11:52 ` Kefeng Wang
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=c69e4147-0aee-407f-84f2-f574f7edf4e6@suse.cz \
--to=vbabka@suse.cz \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=christophe.leroy@csgroup.eu \
--cc=david@redhat.com \
--cc=jannh@google.com \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=rick.p.edgecombe@intel.com \
--cc=ryan.roberts@arm.com \
--cc=shy828301@gmail.com \
--cc=wangkefeng.wang@huawei.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