[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YuQ5FYWMXLw+LpVA@casper.infradead.org>
Date: Fri, 29 Jul 2022 20:46:29 +0100
From: Matthew Wilcox <willy@...radead.org>
To: alexlzhu@...com
Cc: linux-mm@...ck.org, kernel-team@...com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/sys_x86_64: fix VMA alginment for mmap file to THP
On Fri, Jul 29, 2022 at 12:42:14PM -0700, alexlzhu@...vm6390.atn0.facebook.com wrote:
> From: alexlzhu <alexlzhu@...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?
Powered by blists - more mailing lists