From: Matthew Wilcox <willy@infradead.org>
To: alexlzhu@fb.com
Cc: linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/sys_x86_64: fix VMA alginment for mmap file to THP
Date: Fri, 29 Jul 2022 20:46:29 +0100 [thread overview]
Message-ID: <YuQ5FYWMXLw+LpVA@casper.infradead.org> (raw)
In-Reply-To: <20220729194214.1309313-1-alexlzhu@fb.com>
On Fri, Jul 29, 2022 at 12:42:14PM -0700, alexlzhu@devvm6390.atn0.facebook.com wrote:
> From: alexlzhu <alexlzhu@fb.com>
>
> With CONFIG_READ_ONLY_THP_FOR_FS, the Linux kernel supports using THPs for
> read-only mmapped files, such as shared libraries. However, on x86 the
> kernel makes no attempt to actually align those mappings on 2MB boundaries,
> which makes it impossible to use those THPs most of the time. This issue
> applies to general file mapping THP as well as existing setups using
> CONFIG_READ_ONLY_THP_FOR_FS. This is easily fixed by using the alignment
> info passed to vm_unmapped_area. The problem can be seen in
> /proc/PID/smaps where THPeligible is set to 0 on mappings to eligible
> shared object files as shown below.
Can't your filesystem just use thp_get_unmapped_area() like
ext2/ext4/fuse/xfs do?
next prev parent reply other threads:[~2022-07-29 19:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-29 19:42 alexlzhu, alexlzhu
2022-07-29 19:46 ` Matthew Wilcox [this message]
2022-08-01 22:21 ` Alex Zhu (Kernel)
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=YuQ5FYWMXLw+LpVA@casper.infradead.org \
--to=willy@infradead.org \
--cc=alexlzhu@fb.com \
--cc=kernel-team@fb.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